Ubuntu12.04配置指南
参考文档:ubuntu速配指南之软件参考
ubuntu的二进制内核:http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D
安装篇
################################################################
1.下载ubuntu12.04-server引导文件
32位
wget http://archive.ubuntu.com/ubuntu/dists/precise/main/installer-i386/current/images/hd-media/vmlinuz
wget http://archive.ubuntu.com/ubuntu/dists/precise/main/installer-i386/current/images/hd-media/initrd.gz
64位
wget http://archive.ubuntu.com/ubuntu/dists/precise/main/installer-amd64/current/images/hd-media/vmlinuz
wget http://archive.ubuntu.com/ubuntu/dists/precise/main/installer-amd64/current/images/hd-media/initrd.gz
PS:对于ubuntu server必须到上述网站上下载相应的启动映像才能成功启动,而对于一般的桌面iso则不需要,可以直接用iso文件casper目录中的vmlinuz和initrd.gz。
2.将iso和vmlinuz initrd.gz放在一个相同的分区,不能放在ntfs分区,大多数的服务器因版权的原因会默认不支持ntfs格式的文件系统的,建议放在fat32分区或ext3等分区。
3.安装(硬盘安装):
通过grub2(或grub4dos)引导进入grub2命令行,grub也可以,命令关键字有些许不一样
方法一:
set root=(hd0,msdos[x])
linux /vmlinuz boot=casper iso-scan/filename=/ubuntu-12.04-server-i386.iso ro splash
initrd /initrd.gz
boot
或
linux (hd0,msdos[x])/vmlinuz boot=casper iso-scan/filename=/ubuntu-12.04-server-i386.iso ro splash
initrd (hd0,msdos[x])/initrd.gz
boot
方法二:
loopback loop (hd0,msdos[x])/ubuntu-12.04-server-i386.iso
linux (loop)/vmlinuz boot=casper iso-scan/filename=/ubuntu-12.04-server-i386.iso ro splash
initrd (loop)/initrd.gz
boot
方法三:
loopback loop (hd0,msdos[x])/ubuntu-12.04-server-i386.iso
linux (loop)/vmlinuz root=/dev/ram ramdisk_size=65536 devfs=mount,dall ro splash
initrd (loop)/initrd.gz
boot
##############################################################
如果是grub(grub0.97)
root (hd0,[x])
kernel /vmlinuz boot=casper iso-scan/filename=/ubuntu-12.04-server-i386.iso ro splash
initrd /initrd.gz
boot
或
kernel (hd0,[x])/vmlinuz boot=casper iso-scan/filename=/ubuntu-12.04-server-i386.iso ro splash
initrd (hd0,[x])/initrd.gz
boot
注意:因为发行版和grub版本都可能不同,上面红色字体标明的是映射或选择安装介质的不同方法,可以根据需要来组合,有些发行版都可以有些则不行,所以根据需要来组合。
如果是安装liveCD的话,看到界面后要执行如下命令将iso卸载掉,不然安装程序走到最后会过不去!
sudo umount -l /isodevice
配置篇
1.启用root用户并设置密码
sudo passwd root
说明:Ubuntu安装时设置的用户为sudo用户,默认root用户没有启用,需要通过sudo为root设置密码。
2.安装fbterm
sudo apt-get install fbterm language-pack-zh language-support-zh
给予用户使用fbterm的权限
gpasswd -a xxx video
gpasswd -a xxx audio
chmod a+x /dev/fb0
###########
vi .bashrc
###########
PS1='\[\e[35;1m\]\u\[\e[36;1m\]@\[\e[33;1m\]\h\[\e[34;1m\]:\[\e[31;1m\]\W\[\e[32;1;5m\]\$\[\e[0m'
export XMODIFIERS="@im=fcitx"
export GTK_IM_MODULE=xim # 或者是xim,取决于你是否编译了对应的输入法模块
export QT_IM_MODULE=xim # 或者是xim,取决于你是否编译了对应的输入法模块
mplayer /home/liujun/music/start.wav 1>/dev/null 2>&1 &
#################
vi /etc/profile.d/alias.sh
#################
alias si='sudo apt-get install'
alias mp='mplayer -vo fbdev2 -vf screenshot -zoom -x 1366 -y 768 -msglevel all=0 -nodouble -lavdopts threads=16 '
#-vo 输出模式
#-vf screenshot 启用播放过程中的截屏功能
#-zoom -x 1366 -y 768 缩放分辨率,x水平,y垂直
#-msglevel all=0 播放过程中不显示任何信息包括错误
#-lavdopts threads=16 16线程,有些比较老的版本不支持16时将16改为8
alias mplayer='mplayer -vf screenshot -quiet -nodouble -lavdopts threads=16 '
xrdb -merge ~/.Xdefaults 2>/dev/null
############################################################
# BASH: Display that the shell spawned from ranger:
# By putting this in ~/.bashrc, "(in ranger) " will be displayed next to your prompt to notify you that the shell
# spawned from ranger.
[ -n "$RANGER_LEVEL" ] && PS1="$PS1"'(in ranger) '
############################################################
# Bash: cd to last path after exit
# This is a bash function (for ~/.bashrc) to change the directory to the last visited one after ranger quits. You
# can always type "cd -" to go back to the original one.
function ranger-cd {
tempfile='/tmp/chosendir'
/usr/local/bin/ranger --choosedir="$tempfile" "${@:-$(pwd)}"
test -f "$tempfile" &&
if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then
cd -- "$(cat "$tempfile")"
fi
rm -f -- "$tempfile"
}
# This binds Ctrl-O to ranger-cd:
bind '"\C-o":"ranger-cd\C-m"'
###########################################################
function tmux-cd {
/usr/bin/tmux
}
bind '"\C-x":"tmux-cd\C-m"'
##########################################################
function fbterm-cd {
back='/home/liujun/picture/bt4.png'
/home/liujun/picture/fbterm-bi $back
}
bind '"\C-n":"fbterm-cd\C-m"'
##########################################################
function ibus-fbterm-cd {
back='/home/liujun/picture/bt4.png'
/home/liujun/picture/ibus-fbterm-bi $back
}
bind '"\C-v":"ibus-fbterm-cd\C-m"'
##########################################################
if [ "$(tty)" == "/dev/tty[0-9]" ] || [ "$(tty)" == "/dev/pts/[0-100]" ];then
env DISPLAY=:0 fbterm -i fcitx-fbterm
fi
###############
~/.bash_logout
###############
mplayer /home/liujun/music/bash_logout.wav 1>/dev/null 2>&1 &
###############
/etc/rc.local
###############
mplayer /home/liujun/music/login.wav 1> /dev/null 2>&1 &
软件篇
1.安装编译必备库和工具
sudo apt-get install python perl ruby sun-java6-jre make automake cmake autoconf build-essential dpkg-dev intltool gcc g++ gdb gcc-multilib bison checkinstall alien libssl-dev scons libimlib2-dev xorg-dev libgtk2.0-dev gettext libncurses* ia32-lib flex
sudo apt-get install libxml2-dev libbz2-dev libpcre3-dev libssl-dev zlib1g-dev libmcrypt-dev libmhash-dev libmhash2 libcurl4-openssl-dev libpq-dev libpq5 libsyck0-dev
2.压缩解压缩工具
sudo apt-get install p7zip-full p7zip-rar p7zip rar unrar zip unzip cabextract unace
3.程序编辑器
sudo apt-get install vim (emacs)
4.系统服务管理工具
sudo apt-get install chkconfig sysv-rc-conf
5.视频播放器mplayer及解码器
sudo apt-get install mplayer2 mencoder mplayer-gui ffmpeg
6.文本界面音乐播放器及音频控制器
* alsa-utils 高级音频控制器
* moc mpg123 cmus mpg321 xmms2(或mpd) madplay splay [MP3]
* ogg123 [OGG]
* mikmod xmp [various module-formats]
* speex [WAV,Raw PCM等格式转换]
* sox [音频混合器]
* convmv [文件编码转换器]
* pulseaudio-esound-compat
sudo apt-get install alsa-utils moc mpg123 xmms2 (mpd) cmus cplay madplay sox(play) speex pulseaudio-esound-compat mikmod xmp convmv
音乐播放器及歌词插件
sudo apt-get install audacious osdlyrcis
http://code.google.com/p/lrcdis/ #命令行下歌词插件,简单实用炫酷。
问题1:出现无声状态
alsamixer
alsactl init
alsactl store 0
在/usr/src/kernel-source-2.6.7/Documentation/devices.txt找到/dev/dsp的major和minor:
14 char Open Sound System (OSS)
......
3 = /dev/dsp Digital audio
那么
# mknod /dev/dsp c 14 3
如果普通用户对/dev/dsp没有足够权限,增加就可以了,例如
# chmod 666 /dev/dsp
sudo apt-get install gnome-alsamixer asoundconf-gtk gnome-volume-control
问题2:mocp增加~/.moc/config文件后出现FATAL_ERROR: Configuration file is not secure错误
chmod g= ~/.moc/config #去掉用户组权限极可
7.浏览器及邮件客户端
sudo apt-get install firefox lynx w3m w3m-img elinks alpine mutt
/usr/lib/firefox-addons/plugins #火狐adobe flash插件目录
8.命令行图片查看,命令行截图及图片渲染工具
sudo apt-get install fbi fbset fbcat feh imagemagick
#######
fbv
#######
fbterm下图片浏览工具(fbv)FrameBuffer Viewer,支持jpg,png,bmp等格式
按照README,INSTALL里的说明安装依赖的3个包libungif,libjpeg,libpng
********
libungif
********
可以直接从源安装
sudo apt-get install libungif*
http://sourceforge.net/projects/giflib/files/
tar -jxvf giflib-5.0.0.tar.bz2 -C /usr/local/src
cd /usr/local/src/jpeg-8d
./configue && make && make install
********
libjpeg
********
http://www.ijg.org/files/jpegsrc.v8d.tar.gz
tar -zxvf jpegsrc.v8d.tar.gz -C /usr/local/src
cd /usr/local/src/jpeg-8d
./configue && make && make install
********
libpng
********
http://www.libmng.com/pub/png/libpng.html
tar -xvf libpng-1.5.12.tar.xz -C /usr/local/src --xz
cd /usr/local/src/libpng-1.5.12
./configue && make && make install
%%%%%
fbv
%%%%%
s-tech.elsat.net.pl/fbv/
mkdir /usr/local/man/man1
tar -zxvf fbv-1.0b.tar.gz -C /usr/local/src
cd /usr/local/src/fbv-1.0b
./configure && make && make install
9.文件管理器
sudo apt-get install ranger mc rox-filer (thunar gentoo)
10.多窗口终端
sudo apt-get install terminator
11.中文输入法ibus和fcitx
ibus
sudo apt-get install galternatives ibus ibus-table-wubi ibus-pinyin ibus-1.0 im-switch(im-config)
ibus-fbterm
http://ibus-fbterm.googlecode.com/files/ibus-fbterm-0.9.1.tar.gz
sudo setcap 'cap_sys_tty_config+ep' /usr/bin/fbterm
或 sudo chmod u+s /dev/fb0
12.X-window
sudo apt-get install xinit x11-xserver-utils xsnow xpdf xterm xdm
sudo apt-get install xscreensaver xscreensaver-gl xscreensaver-gl-extra xscreensaver-data-extra
###########
xterm中文
###########
vi ~/.Xdefaults
*VT100.font:9x15
*VT100.utf8Fonts.font:-misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1
#Add the line behind to you ~/.bashrc
#xrdb -merge ~/.Xdefaults
13.新立得软件包管理器synaptic
sudo apt-get install synaptic
14.iso打包工具和cd/dvd刻录工具
sudo apt-get install genisoimage(mkisofs) wodim(cdrecord)
15.selinux
sudo apt-get install selinux
16.终端管理器tmux screen(gnu系统默认) byobu(tmux的修改发行,ubuntu自带)
sudo apt-get install tmux
17.下载工具aria2 axel
sudo apt-get install aria2 axel
18.版本控制系统bzr git subversion
sudo apt-get install bzr git-core subversion
19.PDF阅读 mupdf(或gnochm)
mupdf.com
sudo add-apt-repository ppa:guilhem-fr/mupdf
sudo apt-get update
sudo apt-get install mupdf
20.虚拟光驱,acetoneiso
sudo apt-get install acetoneiso
21.chm电子书
sudo apt-get install chmsee
22.星际译王stardict
sudo apt-get install stardict
详见ubuntu官方安装配置文档
http://wiki.ubuntu.org.cn/?title=Stardict&variant=zh-cn
星际译王命令行版http://sdcv.sourceforge.net/
23.屏幕录像,recordmydesktop
sudo apt-get install recordmydesktop gtk-recordmydesktop
注:在“高级”选项“性能”选项卡中不点选“encode on the fly"(录制与编码同时进行) ,24帧即可完美运行,只是保存时速度有点慢罢了。
24.VPN
sudo apt-get install pptpd openvpn
25.其它工具
sudo apt-get install dump dos2unix t2html iotop sysstat
美化篇
1.多系统引导管理器
burg(http://ppa.launchpad.net/n-muench/burg/ubuntu/pool/main/b/burg/)
sudo add-apt-repository ppa:n-muench/burg 或ppa:bean123ch/burgsudo apt-get update
sudo apt-get install burg burg-common burg-emu burg-pc burg-themes-common burg-themes
2.桌面美化优化软件
a. ubuntu-tweak
vim /etc/apt/source.list 添加
deb http://ppa:lauchpad.net/tualatrix/ppa/ubuntu precise main
deb-src http://ppa:lauchpad.net/tualatrix/ppa/ubuntu precise main
sudo apt-get update
sudo apt-get install ubuntu-tweak
或 直接到其官网下载二进制软件包安装 ubuntu-tweak.com
b.ailurus
sudo add-apt-repository ppa:ailurus
sudo apt-get update
sudo atp-get install ailurus
c.compiz
sudo apt-get install compizconfig-setting-manager compiz-fusion-plugins-main compiz-fusion-plugins-extra compiz-plugins fusion-icon simple-ccsm
sudo apt-get install compiz-dev intltool compiz-fussion-bcop
tar -zxvf compiz-plugins-unsupported -C /usr/local/src #漂雪养鱼
./configure && make && make install
d.xsnow (圣诞漂雪)
sudo apt-get install xsnow
e.cairo-dock (类似苹果系统的dock,但特效更多更震撼)
sudo apt-get install cairo-dock
f.emerald (窗口装饰器,窗口透明效果)
sudo apt-get install libwnck1.0-cil-dev libwnck-dev libdecoration0-dev
wget cgit.compiz.org/fusion/decorators/emerald/emerald-0.9.5.tar.gz
tar -zxvf emerald-0.9.5.tar.gz -C /usr/local/src
cd /usr/local/src
./autogen.sh
make clean && make disclean
./configure && make && make install
或
sudo add-apt-repository ppa:malteworld/compiz
sudo apt-get update
sudo atp-get install emerald
游戏篇
sudo apt-get install gfceu kxmame dosbox
gfceu #nes模拟器
kxmame #rom模拟器
dosbox #dos游戏或应用程序模拟器
例如:dosbox运行超级玛丽
先把压缩包mario.zip解压到某个目录,
cd /tmp
unzip mario.zip
启动dosbox
dosbox
z:\> mount c: /tmp/mario
z:\> c:
c:\> mario
ctrl 加速
shift 移动屏幕
space 子弹
alt+回车 全屏
多媒体篇
1.视频编辑
sudo apt-get install pitivi
2.音频编辑
sudo apt-get install audacity
3.iphone, ipod同步
sudo apt-get install gtkpod
4.失量绘图(类似于adobe illustrator)
sudo apt-get install inkscape
5.聊天
sudo apt-get install pidgin finch
自定义桌面篇
************************************************************
桌面环境 Window Manager
************************************************************
########
fluxbox
########
./configure --enable-xinerama --enable-imlib2 --enable-nls
1.轻量级的强大图片查看器
sudo apt-get install gqview
2.桌面图标
sudo apt-get install idesk (fbdesk gdesklets)
3.连网工具
sudo apt-get install wicd wicd-curses(wicd-gtk) (network-manager-gnome)
4.主题
* xcompmgr:透明及其他一些特效。
* xappearance:管理 GTK、图标和鼠标主题。
* nitrogen:图形化壁纸管理工具。
* dmenu:图形化命令运行和命令补全。
sudo apt-get install xcompmgr nitrogen lxappearance
http://sourceforge.net/projects/fluxspace/files/fluxspace/0.4.0_alpha/fluxspace-0.4.0_alpha.tar.gz
5.3ddesktop
sudo apt-get install libgl-mesa-dev libglu1-mesa-dev
**********
配置文件
**********
1.vi ~/.xinitrc
#exec fvwm
exec startfluxbox
2.vi ~/.fluxbox/init #设置壁纸
session.screen0.rootCommand: fbsetbg -r ~/picture #随机从目录中选取一张壁纸
session.screen0.rootCommand: fbsetbg -C ~/.fluxbox/splash.png #设置fluxbox splash欢迎屏幕
session.groupFile: ~/.fluxbox/groups
3.vi ~/.fluxbox/groups
XTerm
4.vi ~/.fluxbox/keys
Mod4 e :ExecCommand rox #资源管理器
Mod4 d :ShowDesktop #显示桌面
Mod4 l :ExecCommand ~/.fluxbox/lrcdis &
Mod4 s :ExecCommand xsnow &
5.vi /usr/share/xsessions/fluxbox.desktop #加入xdm的管理队列
[Desktop Entry]
Encoding=UTF-8
Name=Fluxbox
Comment=Fluxbox
Exec=startfluxbox
Icon=fluxbox
Type=XSession
5.vi ~/.fluxbox/menu #左键菜单中文化
# Generated by fluxbox-generate_menu
#
# If you read this it means you want to edit this file manually, so here
# are some useful tips:
#
# - You can add your own menu-entries to ~/.fluxbox/usermenu
#
# - If you miss apps please let me know and I will add them for the next
# release.
#
# - The -r option prevents removing of empty menu entries and lines which
# makes things much more readable.
#
# - To prevent any other app from overwriting your menu
# you can change the menu name in ~/.fluxbox/init to:
# session.menuFile: ~/.fluxbox/my-menu
[begin] (Fluxbox-1.3.2)
[encoding] {UTF-8}
[exec] (火狐) {firefox}
[exec] (terminator) {terminator}
[submenu] (网络)
[submenu] (浏览器)
[exec] (火狐) {firefox}
[exec] (w3m) {xterm -e w3m fluxbox.org}
[exec] (lynx) {xterm -e lynx fluxbox.org}
[end]
[submenu] (邮件)
[exec] (alpine) {xterm -e alpine}
[exec] (mutt) {xterm -e mutt}
[end]
[submenu] (FTP)
[exec] (pftp) {xterm -e pftp}
[exec] (ftp) {xterm -e ftp}
[end]
[end]
[submenu] (编辑器)
[exec] (vim) {xterm -e vim}
[exec] (nano) {xterm -e nano}
[end]
[submenu] (文件管理器)
[exec] (rox) {rox}
[exec] (ranger) {xterm -e ranger}
[exec] (mc) {xterm -e mc}
[end]
[submenu] (多媒体)
[submenu] (图像)
[exec] (gqview) {gqview}
[exec] (xscreensaver-demo) {xscreensaver-demo}
[end]
[submenu] (音频)
[exec] (mocp) {xterm -e mocp}
[exec] (cplay) {xterm -e cplay}
[exec] (歌词) {~/.fluxbox/lrcdis &}
[end]
[submenu] (视频)
[exec] (gmplayer) {gmplayer}
[end]
[submenu] (X-utils)
[exec] (xfontsel) {xfontsel}
[exec] (editres) {editres}
[exec] (viewres) {viewres}
[exec] (Reload .Xdefaults) {xrdb -load $HOME/.Xdefaults}
[end]
[end]
[submenu] (办公)
[exec] (evince) {evince}
[exec] (xpdf) {xpdf}
[exec] (mupdf) {mupdf}
[end]
[submenu] (游戏)
[exec] (Nes模拟器) {fceux}
[exec] (Dos模拟器) {dosbox}
[end]
[submenu] (系统工具)
[exec] (新立德软件包管理器) {synaptic}
[exec] (音频设置) {xterm -e alsamixer}
[exec] (AdobeFlashPlayer设置) {flash-player-properties}
[exec]