个人工具
登录
查看“Ubuntu6.06HowTo”的源代码 - Ubuntu中文
页面
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“Ubuntu6.06HowTo”的源代码
来自Ubuntu中文
←
Ubuntu6.06HowTo
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
Ubuntu 6.06 (Dapper Drake) 指南 来源: http://www.cs.cornell.edu/%7Edjm/ubuntu/ 我也是一个 [http://www.ubuntu.com/ Ubuntu] (Linux水平也一般) 新手. 使用 Ubuntu 因为比较好玩,兴趣和刺激. 为了当我下一次安装 Ubuntu 是方便,在本页记下了所有的步骤. 我希望也能帮助其它人. June 2, 2006: 我今天升级到了 Dapper Drake 并修改了本页的部分内容. 我将不再更新 [http://www.cs.cornell.edu/~djm/ubuntu/index_breezy.htm Breezy Badger page] . === 安装 Ubuntu === 下面是本节的屏幕抓图 [http://shots.osdir.com/slideshows/slideshow.php?release=659&slide=4&title=ubuntu+6.06+screenshots OSDir's screenshot gallery]. * 下载 [http://www.ubuntu.com/download/ Dapper Drake 安装 CD/DVD 映像文件], 然后 [https://wiki.ubuntu.com/BurningIsoHowto/ 刻录映像文件] 到 CD/DVD. * 从 CD/DVD 启动. 这通常可以简单从 CD/DVD 启动电脑. 有些电脑你可能需要在启动的一段时间内按下 F12 (或 F2, 或 DEL, 或 其它什么的) 然后从菜单选择从 CD 启动. * 选择 [http://shots.osdir.com/slideshows/original.php?release=659&slide=1 启动或安装 Ubuntu] 条件. * 当电脑 [http://shots.osdir.com/slideshows/original.php?release=659&slide=3 从 Live CD 启动] 这个版本的 Ubuntu 后, 双击 [http://shots.osdir.com/slideshows/original.php?release=659&slide=4 安装图标]. * 选择 [http://shots.osdir.com/slideshows/original.php?release=659&slide=5 语言]; [http://shots.osdir.com/slideshows/original.php?release=659&slide=6 地区和时区]; [http://shots.osdir.com/slideshows/original.php?release=659&slide=7 键盘]; 和 [http://shots.osdir.com/slideshows/original.php?release=659&slide=8 用户名, 密码, 和电脑名]. * {|border="1" cellspacing="0" |目的||尺寸||文件系统 |- |swap 交换空间||1 - 2GB||linux-swap |- |root 目录 (<code><nowiki>/</nowiki></code>)||4 - 8GB||reiserfs (或 ext3) |- |home 目录 (<code><nowiki>/home</nowiki></code>)||剩余空间||reiserfs (或 ext3) |} * [http://shots.osdir.com/slideshows/original.php?release=659&slide=10 检查你的选择], 然后点击 "Install". * 阅读一些杂志或者干些别的事情 [http://shots.osdir.com/slideshows/original.php?release=659&slide=11 当] [http://shots.osdir.com/slideshows/original.php?release=659&slide=12 Ubuntu] [http://shots.osdir.com/slideshows/original.php?release=659&slide=13 安装时]. * 当安装完成后,会得到一个提示, 点击 "[http://shots.osdir.com/slideshows/original.php?release=659&slide=15 Reboot the computer]" 按钮. 确信取出了 CD/DVD 这样电脑不会重新从 Live CD 启动. * 如果 Ubuntu 在其它的分区上检测到了 Windows , 将提示你 [http://www.cs.cornell.edu/~djm/ubuntu/grub.png 使用 GRUB 多重启动]. 最上面的选项是 Ubuntu. 选择它, 或者仅仅等到计时器到0. * 但电脑 [http://shots.osdir.com/slideshows/original.php?release=659&slide=16 重启] 到第一次安装的 Ubuntu, 使用你早前安装时设置的用户名和密码[http://shots.osdir.com/slideshows/original.php?release=659&slide=17 登录] . * 祝贺! 你现在已经开始 [http://shots.osdir.com/slideshows/original.php?release=659&slide=25 运行 Ubuntu]! 为什么这么容易? :) === 初步设置 === ==== 更新和升级包 ==== * <pre><nowiki> sudo apt-get update sudo apt-get upgrade </nowiki></pre> ==== 安装 nVidia 显卡驱动 ==== 安装 nVidia 显卡驱动会自动修复某些屏幕分辨率的问题. * <pre><nowiki> sudo apt-get install nvidia-glx </nowiki></pre> * <pre><nowiki> sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup.nvidia sudo nvidia-glx-config enable </nowiki></pre> <pre><nowiki> sudo gedit /etc/X11/xorg.conf </nowiki></pre> <pre><nowiki> Section "Device" ... Driver "nv" ... EndSection </nowiki></pre> <pre><nowiki> Section "Device" ... Driver "nvidia" ... EndSection </nowiki></pre> * <pre><nowiki> sudo gedit /usr/share/applications/nvidia-settings.desktop </nowiki></pre> <pre><nowiki> [Desktop Entry] Name=NVIDIA Settings Comment=nVidia Settings Exec=nvidia-settings Icon= Terminal=false Type=Application Categories=Application;System; </nowiki></pre> * <pre><nowiki> sudo gedit /etc/X11/xorg.conf </nowiki></pre> <pre><nowiki> Section "Device" Identifier "NVIDIA Corporation ..." ... EndSection </nowiki></pre> <pre><nowiki> Section "Device" Identifier "NVIDIA Corporation ..." ... Option "NoLogo" EndSection </nowiki></pre> * (可选) [[#restart-gdm|重启 Gnome Desktop Manager]] 让配置生效. 这里是自动执行1-4步的脚本: <pre><nowiki> sudo apt-get install nvidia-glx sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup.nvidia sudo nvidia-glx-config enable sudo sed -i -e's@Driver[ \t]\{1,\}"nv"@Driver\t\t"nvidia"\n\tOption\t\t"NoLogo"@g' /etc/X11/xorg.conf (printf '[Desktop Entry]\nName=NVIDIA Settings\nComment=nVidia Settings\nExec=nvidia-settings\nIcon=\nTerminal=false\nType=Application\nCategories=Application;System;\n') | sudo tee /usr/share/applications/nvidia-settings.desktop </nowiki></pre> ==== 激活 5-button 鼠标 ==== * <pre><nowiki> sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup.mouse sudo gedit /etc/X11/xorg.conf </nowiki></pre> <pre><nowiki> Section "InputDevice" Identifier "Configured Mouse" Driver "mouse" ... Option "Protocol" "ExplorerPS/2" ... Option "Emulate3Buttons" "true" ... EndSection </nowiki></pre> <pre><nowiki> Section "InputDevice" Identifier "Configured Mouse" Driver "mouse" ... Option "Protocol" "ExplorerPS/2" ... Option "Emulate3Buttons" "false" Option "Buttons" "7" Option "ButtonMapping" "1 2 3 6 7" ... EndSection </nowiki></pre> * (可选) [[#restart-gdm|重启 Gnome Desktop Manager]] 让配置生效. 这里是自动执行1步的脚本: <pre><nowiki> sudo sed -i.backup.mouse -e's@[ \t]*Option[ \t]\{1,\}"Emulate3Buttons"[ \t]\{1,\}"true"@\tOption\t\t"Emulate3Buttons"\t"false"\n\tOption\t\t"Buttons"\t\t"7"\n\tOption\t\t"ButtonMapping"\t\t"1 2 3 6 7"@g' /etc/X11/xorg.conf </nowiki></pre> ==== 激活 CD/DVD 弹出 ==== * <pre><nowiki> sudo sysctl dev.cdrom.lock=0 </nowiki></pre> * <pre><nowiki> sudo cp /etc/sysctl.conf /etc/sysctl.conf.backup.eject sudo gedit /etc/sysctl.conf </nowiki></pre> <pre><nowiki> dev.cdrom.lock=0 </nowiki></pre> 这里是自动执行1步的脚本: <pre><nowiki> if ! cat /etc/sysctl.conf | grep "dev.cdrom.lock=0"; then sudo cp /etc/sysctl.conf /etc/sysctl.conf.backup.eject; >> /etc/sysctl.conf'; fi; </nowiki></pre> ==== 增加扩展库 ==== * <pre><nowiki> sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup </nowiki></pre> * <pre><nowiki> sudo gedit /etc/apt/sources.list </nowiki></pre> <pre><nowiki> deb http://us.archive.ubuntu.com/ubuntu dapper main restricted deb-src http://us.archive.ubuntu.com/ubuntu dapper main restricted deb http://security.ubuntu.com/ubuntu dapper-security main restricted deb-src http://security.ubuntu.com/ubuntu dapper-security main restricted deb http://us.archive.ubuntu.com/ubuntu dapper-updates main restricted deb-src http://us.archive.ubuntu.com/ubuntu dapper-updates main restricted deb http://us.archive.ubuntu.com/ubuntu dapper universe multiverse deb-src http://us.archive.ubuntu.com/ubuntu dapper universe multiverse deb http://security.ubuntu.com/ubuntu dapper-security universe multiverse deb-src http://security.ubuntu.com/ubuntu dapper-security universe multiverse deb http://us.archive.ubuntu.com/ubuntu dapper-updates universe multiverse deb-src http://us.archive.ubuntu.com/ubuntu dapper-updates universe multiverse deb http://archive.ubuntu.com/ubuntu dapper-backports main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu dapper-backports main restricted universe multiverse #deb http://packages.freecontrib.org/ubuntu/plf/ dapper free non-free #deb-src http://packages.freecontrib.org/ubuntu/plf/ dapper free non-free #deb ftp://ftp.free.fr/pub/Distributions_Linux/plf/ubuntu/plf/ dapper free non-free #deb-src ftp://ftp.free.fr/pub/Distributions_Linux/plf/ubuntu/plf/ dapper free non-free </nowiki></pre> * <pre><nowiki> sudo apt-get update </nowiki></pre> 这里是自动执行1-3步的脚本(需要Internet访问): <pre><nowiki> wget -c -o /tmp/sources.list http://www.cs.cornell.edu/~djm/ubuntu/sources.list sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup sudo cp /tmp/sources.list /etc/apt/sources.list sudo apt-get update </nowiki></pre> === 常用的包 === ==== 安装 Microsoft 字体 ==== * <pre><nowiki> sudo apt-get install msttcorefonts </nowiki></pre> ==== 安装多媒体解码驱动和播放器 ==== * [[add-repositories 增加扩展库]]. * <pre><nowiki> wget -c -o /tmp/w32codecs.deb ftp://ftp.free.fr/pub/Distributions_Linux/plf/ubuntu/plf/pool/dapper/i386/non-free/w32codecs/w32codecs_20050412-1plf4_i386.deb wget -c -o /tmp/libdvdcss2.deb ftp://ftp.free.fr/pub/Distributions_Linux/plf/ubuntu/plf/pool/dapper/i386/free/libdvdcss2/libdvdcss2_1.2.9-1plf3_i386.deb sudo dpkg -i /tmp/w32codecs.deb /tmp/libdvdcss2.deb </nowiki></pre> * <pre><nowiki> wget -c -o /tmp/w32codecs.deb ftp://ftp.nerim.net/debian-marillat/pool/main/w/w32codecs/w32codecs_20050412-0.4_i386.deb sudo dpkg -i /tmp/w32codecs.deb sudo apt-get install libdvdread3 sudo /usr/share/doc/libdvdread3/examples/install-css.sh </nowiki></pre> * <pre><nowiki> sudo apt-get install lame sox ffmpeg mjpegtools mpg321 vorbis-tools </nowiki></pre> * <pre><nowiki> sudo apt-get install totem-xine libxine-extracodecs </nowiki></pre> * <pre><nowiki> sudo apt-get install totem-gstreamer gstreamer0.10-plugins-good gstreamer0.10-plugins-bad gstreamer0.10-plugins-ugly gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly-multiverse gstreamer0.10-gl gstreamer0.10-ffmpeg </nowiki></pre> * <pre><nowiki> (printf '#!/bin/bash\ntotem --enqueue $NAUTILUS_SCRIPT_SELECTED_URIS\n') > ~/.gnome2/nautilus-scripts/totem-enqueue (printf '#!/bin/bash\ntotem --replace $NAUTILUS_SCRIPT_SELECTED_URIS\n') > ~/.gnome2/nautilus-scripts/totem-replace chmod +x ~/.gnome2/nautilus-scripts/totem-enqueue ~/.gnome2/nautilus-scripts/totem-replace </nowiki></pre> * <pre><nowiki> sudo apt-get install mplayer sudo sed -i.backup -e's@vo=x11,@vo=xv,@g' /etc/mplayer/mplayer.conf </nowiki></pre> * <pre><nowiki> sudo apt-get install mozilla-mplayer </nowiki></pre> ==== 安装 TiMidity (MIDI 播放器) ==== * <pre><nowiki> sudo apt-get install timidity timidity-interfaces-extra </nowiki></pre> * <pre><nowiki> sudo gedit /usr/share/applications/timidity.desktop </nowiki></pre> <pre><nowiki> [Desktop Entry] Encoding=UTF-8 Name=Timidity MIDI Player Comment=Play MIDI audio files Exec=timidity -ig Terminal=false Type=Application StartupNotify=false MimeType=audio/midi; Categories=Application;AudioVideo; Icon= #NoDisplay=true </nowiki></pre> * <pre><nowiki> sudo cp /usr/share/applications/defaults.list /usr/share/applications/defaults.list.backup.midi sudo gedit /usr/share/applications/defaults.list </nowiki></pre> <pre><nowiki> audio/midi=timidity.desktop </nowiki></pre> * <pre><nowiki> wget -c -o /tmp/timidity-patches-eaw http://www.fbriere.net/debian/dists/etch/misc/deb/timidity-patches-eaw_12-0fbriere.1_all.deb sudo dpkg -i /tmp/timidity-patches-eaw.deb sudo gedit /etc/timidity/timidity.cfg </nowiki></pre> <pre><nowiki> source /etc/timidity/freepats.cfg </nowiki></pre> <pre><nowiki> source /usr/share/doc/timidity-patches-eaw/examples/timidity.cfg </nowiki></pre> * <pre><nowiki> sudo gedit /etc/timidity/timidity.cfg </nowiki></pre> <pre><nowiki> opt EFresamp=d #disable resampling (or "opt EFresamp=l" for linear resampling) opt EFvlpf=d #disable VLPF opt EFreverb=d #disable reverb opt EFchorus=d #disable chorus opt EFdelay=d #disable delay </nowiki></pre> 这里是自动执行1-4步的脚本: <pre><nowiki> sudo apt-get install timidity timidity-interfaces-extra (printf '[Desktop Entry]\nEncoding=UTF-8\nName=Timidity MIDI Player\nComment=Play MIDI audio files\nExec=timidity -ig\nTerminal=false\nType=Application\nStartupNotify=false\nMimeType=audio/midi;\nCategories=Application;AudioVideo;\n#Icon=???\n#NoDisplay=true\n') | sudo tee /usr/share/applications/timidity.desktop sudo cp /usr/share/applications/defaults.list /usr/share/applications/defaults.list.backup.midi if ! cat /usr/share/applications/defaults.list | grep "audio/midi"; then (printf 'audio/midi=timidity.desktop\n') | sudo tee -a /usr/share/applications/defaults.list; else sudo sed -i -e's@audio/midi.*$@audio/midi=timidity.desktop@g' /usr/share/applications/defaults.list; fi; wget -c -o /tmp/timidity-patches-eaw http://www.fbriere.net/debian/dists/etch/misc/deb/timidity-patches-eaw_12-0fbriere.1_all.deb sudo dpkg -i /tmp/timidity-patches-eaw.deb sudo sed -i.backup -e's@source /etc/timidity/freepats.cfg@source /usr/share/doc/timidity-patches-eaw/examples/timidity.cfg@g' /etc/timidity/timidity.cfg </nowiki></pre> ==== 安装 GParted (磁盘分区工具) ==== * <pre><nowiki> sudo apt-get install gparted </nowiki></pre> ==== 安装 Mozilla Thunderbird (email 客户端) ==== * <pre><nowiki> sudo apt-get install mozilla-thunderbird </nowiki></pre> * (optional) See how to [http://www.cs.cornell.edu/~djm/ubuntu/#restore-mozilla-icons restore Mozilla Firefox and Thunderbird icons]. ==== 安装 GnomeBaker (CD 刻录) ==== * <pre><nowiki> sudo apt-get install gnomebaker </nowiki></pre> ==== 安装 Sound Juicer (audio CD 抓轨) ==== * <pre><nowiki> sudo apt-get install sound-juicer </nowiki></pre> ==== 安装 Acroread (PDF 阅读器) ==== * <pre><nowiki> sudo apt-get install acroread </nowiki></pre> * <pre><nowiki> sudo sed -i.backup.acroread -e's@application/pdf=evince.desktop@application/pdf=AdobeReader.desktop@g' /usr/share/applications/defaults.list </nowiki></pre> * <pre><nowiki> sudo apt-get install mozilla-acroread </nowiki></pre> ==== 为 Firefox 安装 Flash 插件 ==== * <pre><nowiki> sudo apt-get install flashplugin-nonfree sudo update-flashplugin </nowiki></pre> ==== 安装 Sun Java ==== (See the [https://wiki.ubuntu.com/RestrictedFormats Restricted Formats page].) * <pre><nowiki> sudo apt-get install sun-java5-jre sun-java5-plugin sudo update-alternatives --config java </nowiki></pre> ==== 安装 teTeX (LaTeX) ==== * <pre><nowiki> sudo apt-get install tetex-base tetex-bin tetex-extra </nowiki></pre> * Here is a [http://www.cs.cornell.edu/~djm/tex/main.tex sample LaTeX file] and the [http://www.cs.cornell.edu/~djm/tex/Makefile Makefile] to compile it with. ==== 安装 Octave (Matlab 代替) ==== * <pre><nowiki> sudo apt-get install octave </nowiki></pre> ==== 安装 Gnuplot (绘制/图形 工具) ==== * <pre><nowiki> sudo apt-get install gnuplot </nowiki></pre> ==== 安装 开发工具 ==== * <pre><nowiki> sudo apt-get install build-essential manpages-dev </nowiki></pre> * <pre><nowiki> sudo apt-get install libgmp3-dev libgmp3-doc </nowiki></pre> * <pre><nowiki> sudo apt-get install libxxf86vm-dev nvidia-glx-dev ftgl-dev sudo apt-get install libsdl1.2-dev libsdl-ttf2.0-dev libsdl-image1.2-dev libsdl-mixer1.2-dev sudo apt-get install libsdl-sound1.2-dev libsdl-net1.2-dev </nowiki></pre> <pre><nowiki> sudo ln -s /usr/include/freetype2/freetype /usr/include/freetype </nowiki></pre> ==== 安装 CVS (版本控制系统) ==== * <pre><nowiki> sudo apt-get install cvs </nowiki></pre> * <pre><nowiki> sudo apt-get install tkcvs </nowiki></pre> ==== 安装 GVim (编辑器) ==== * <pre><nowiki> sudo apt-get install vim-gnome </nowiki></pre> * (optional) Tinker with your <code><nowiki>~/.vimrc</nowiki></code> file to your heart's content. (See my [http://www.cs.cornell.edu/~djm/ubuntu/vimrc ~/.vimrc] for an example.) * <pre><nowiki> sudo sed -i.backup.gvim -e's@gedit.desktop@gvim.desktop@g' -e's@text/x-csrc=gvim.desktop@text/x-csrc=gvim.desktop\ntext/x-c++hdr=gvim.desktop\ntext/x-c++src=gvim.desktop\ntext/x-csharp=gvim.desktop\ntext/x-tex=gvim.desktop@g' /usr/share/applications/defaults.list sudo sed -i.backup -e's@MimeType=text/plain;@MimeType=text/plain;text/html;text/css;text/xml;text/x-dtd;text/x-chdr;text/x-csrc;text/x-c++hdr;text/x-c++src;text/x-java;text/x-csharp;text/x-tex;text/x-bibtex;text/x-readme;@g' -e's@NoDisplay=true@NoDisplay=false@g' /usr/share/applications/gvim.desktop </nowiki></pre> ==== 安装 jEdit (编辑器) ==== * [http://www.cs.cornell.edu/~djm/ubuntu/#sun-java Install Java]. * <pre><nowiki> sudo gedit /etc/apt/sources.list </nowiki></pre> <pre><nowiki> deb http://dl.sourceforge.net/sourceforge/jedit ./ deb-src http://dl.sourceforge.net/sourceforge/jedit ./ </nowiki></pre> * <pre><nowiki> sudo apt-get update sudo apt-get install jedit </nowiki></pre> * <pre><nowiki> sudo gedit /usr/bin/jedit </nowiki></pre> <pre><nowiki> ... ${JEDIT} -jar "/usr/share/jedit/jedit.jar" $@ </nowiki></pre> <pre><nowiki> ... ${JEDIT} -jar "/usr/share/jedit/jedit.jar" -reuseview $@ </nowiki></pre> ==== 安装 游戏 (ScummVM) ==== * <pre><nowiki> sudo apt-get install supertux scummvm sudo apt-get install beneath-a-steel-sky flight-of-the-amazon-queen </nowiki></pre> ==== 安装 OpenSSH (SSH 服务) ==== * <pre><nowiki> sudo apt-get install openssh-server </nowiki></pre> * You might also need to [http://www.cs.cornell.edu/~djm/ubuntu/#send-dhcp send your host-name to your DHCP server]. === 排除故障 === ==== 修复声音 ==== 参考 http://ubuntuguide.org/#configuresoundproperly. ==== 修复屏幕分辨率 ==== 参考 https://wiki.ubuntu.com/FixVideoResolutionHowto 更多信息. 下面是我的配置: * <pre><nowiki> sudo ddcprobe | grep monitorrange </nowiki></pre> <pre><nowiki> sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup.sync_and_refresh sudo gedit /etc/X11/xorg.conf </nowiki></pre> <pre><nowiki> Section "Monitor" ... HorizSync 30-96 VertRefresh 50-160 EndSection </nowiki></pre> ==== 修复 Xine's WMV 播放 ==== * <pre><nowiki> cp ~/.xine/catalog.cache ~/.xine/catalog.cache.backup gedit ~/.xine/catalog.cache </nowiki></pre> <pre><nowiki> [/usr/lib/xine/plugins/1.0.0/xineplug_decode_w32dll.so] size=173768 mtime=1112804124 type=131 api=15 id=win32a version=10000 supported_types=50593792 52428800 52822016 ... (long line truncated) decoder_priority=1 </nowiki></pre> <pre><nowiki> decoder_priority=1</nowiki></pre> <pre><nowiki> decoder_priority=7</nowiki></pre> ==== 修复 jumpy/skipping/choppy/stuttering CD/DVD 播放 ==== 参考 http://ubuntuguide.org/#speedupcddvdrom. * <pre><nowiki> sudo hdparm -d /dev/[device] </nowiki></pre> * <pre><nowiki> sudo hdparm -d1 /dev/[device] sudo cp /etc/hdparm.conf /etc/hdparm.conf.backup.dma sudo gedit /etc/hdparm.conf </nowiki></pre> <pre><nowiki> /dev/[device] { dma === on } </nowiki></pre> ==== 修复 "There are differences between boot sector and its backup" 错误 ==== * <pre><nowiki> sudo gedit /etc/fstab </nowiki></pre> <pre><nowiki> /dev/hda1 /media/hda1 vfat defaults,utf8,umask=007,gid=46 0 1 </nowiki></pre> <pre><nowiki> /dev/hda1 /media/hda1 vfat iocharset=utf8,umask=000 0 0 </nowiki></pre> === 定制 === ==== 电脑改名 ==== * <pre><nowiki> gksudo network-admin </nowiki></pre> * (可选) 如果你远程访问你的电脑, 你可能需要 [http://www.cs.cornell.edu/~djm/ubuntu/#send-dhcp tell your DHCP server your host-name]. ==== 自定义风格和字体 ==== * <pre><nowiki> gnome-theme-manager </nowiki></pre> * <pre><nowiki> gnome-font-properties </nowiki></pre> ==== 重新定义 /home 目录 ==== 重要:这个仅仅适用于你移动你的 home 目录到其它驱动器,或者激活其它驱动器上存在的 home 目录. * <pre><nowiki> sudo mkdir /media/new </nowiki></pre> <pre><nowiki> sudo mount -t ext3 /dev/hdb1 /mnt/new/ </nowiki></pre> <pre><nowiki> sudo mount -t reiserfs -o notail /dev/hdb1 /mnt/new/ </nowiki></pre> <pre><nowiki> sudo cp -R -p /home/[user] /mnt/new/ sudo chown [user]:[user] /mnt/new/[user] sudo umount /mnt/new/ </nowiki></pre> * <pre><nowiki> sudo nano /etc/fstab </nowiki></pre> <pre><nowiki> /dev/hdb1 /home ext3 defaults,errors=remount-ro 0 2 </nowiki></pre> <pre><nowiki> /dev/hdb1 /home reiserfs defaults,notail 0 2 </nowiki></pre> * [http://www.cs.cornell.edu/~djm/ubuntu/#restart-gdm Restart Gnome Desktop Manager]. ==== 屏蔽 USplash ==== * <pre><nowiki> sudo cp /boot/grub/menu.lst /boot/grub/menu.lst.backup sudo gedit /boot/grub/menu.lst </nowiki></pre> <pre><nowiki> kernel /boot/... root=... ro quiet splash </nowiki></pre> <pre><nowiki> kernel /boot/... root=... ro quiet </nowiki></pre> ==== 激活 在启动时的绿色 [ok] 信息 ==== * [http://www.cs.cornell.edu/~djm/ubuntu/#disable-usplash Disable USplash]. * <pre><nowiki> sudo cp /lib/lsb/init-functions /lib/lsb/init-functions.backup sudo gedit /lib/lsb/init-functions </nowiki></pre> <pre><nowiki> log_success_msg () { echo "$@" } </nowiki></pre> <pre><nowiki> log_success_msg () { if log_use_fancy_output; then GREEN=`$TPUT setaf 2` NORMAL=`$TPUT op` echo "$GREEN*$NORMAL $@" else echo "$@" fi } </nowiki></pre> ==== 重置 Mozilla Firefox 和 Thunderbird 图标 ==== * <pre><nowiki> wget -c http://www.cs.cornell.edu/~djm/ubuntu/mozilla-icons/mozilla-firefox.png wget -c http://www.cs.cornell.edu/~djm/ubuntu/mozilla-icons/document.png chmod 644 mozilla-firefox.png document.png sudo dpkg-divert --rename /usr/share/pixmaps/mozilla-firefox.png sudo dpkg-divert --rename /usr/share/pixmaps/mozilla-firefox.xpm sudo dpkg-divert --rename /usr/lib/mozilla-firefox/icons/default.xpm sudo dpkg-divert --rename /usr/lib/mozilla-firefox/icons/document.png sudo dpkg-divert --rename /usr/lib/mozilla-firefox/chrome/icons/default/default.xpm sudo cp mozilla-firefox.png /usr/share/pixmaps/mozilla-firefox.png sudo cp mozilla-firefox.png /usr/share/pixmaps/mozilla-firefox.xpm sudo cp mozilla-firefox.png /usr/lib/mozilla-firefox/icons/default.xpm sudo cp document.png /usr/lib/mozilla-firefox/icons/document.png sudo cp mozilla-firefox.png /usr/lib/mozilla-firefox/chrome/icons/default/default.xpm </nowiki></pre> * <pre><nowiki> wget -c http://www.cs.cornell.edu/~djm/ubuntu/mozilla-icons/mozilla-thunderbird.xpm chmod 644 mozilla-thunderbird.xpm sudo dpkg-divert --rename /usr/share/pixmaps/mozilla-thunderbird.xpm sudo dpkg-divert --rename /usr/share/pixmaps/mozilla-thunderbird-menu.xpm sudo dpkg-divert --rename /usr/share/pixmaps/mozilla-thunderbird-pm-menu.xpm sudo dpkg-divert --rename /usr/lib/mozilla-thunderbird/chrome/icons/default/mozilla-thunderbird.xpm sudo dpkg-divert --rename /usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow16.xpm sudo dpkg-divert --rename /usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow.xpm sudo dpkg-divert --rename /usr/lib/mozilla-thunderbird/chrome/icons/default/default.xpm sudo cp mozilla-thunderbird.xpm /usr/share/pixmaps/mozilla-thunderbird.xpm sudo cp mozilla-thunderbird.xpm /usr/share/pixmaps/mozilla-thunderbird-menu.xpm sudo cp mozilla-thunderbird.xpm /usr/share/pixmaps/mozilla-thunderbird-pm-menu.xpm sudo cp mozilla-thunderbird.xpm /usr/lib/mozilla-thunderbird/chrome/icons/default/mozilla-thunderbird.xpm sudo cp mozilla-thunderbird.xpm /usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow16.xpm sudo cp mozilla-thunderbird.xpm /usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow.xpm sudo cp mozilla-thunderbird.xpm /usr/lib/mozilla-thunderbird/chrome/icons/default/default.xpm </nowiki></pre> === 硬件 === ==== Mount ==== * <pre><nowiki> sudo mount /dev/hdb1 [mount_point_dir] -t reiserfs -o notail </nowiki></pre> * <pre><nowiki> sudo mount /dev/hdb1 [mount_point_dir] -t ext3 </nowiki></pre> * <pre><nowiki> sudo mount /dev/hda1 [mount_point_dir] -t ntfs -o nls=utf8,umask=0222 </nowiki></pre> * <pre><nowiki> sudo mount /dev/hda1 [mount_point_dir] -t vfat -o iocharset=utf8,umask=000 </nowiki></pre> * <pre><nowiki> sudo mount /media/cdrom0/ -o unhide </nowiki></pre> * <pre><nowiki> sudo modprobe loop sudo mount file.iso /media/iso/ -t iso9660 -o loop -r </nowiki></pre> ==== Unmount ==== * <pre><nowiki> sudo umount [mount_point_dir] </nowiki></pre> * <pre><nowiki> sudo umount -l [mount_point_dir] </nowiki></pre> ==== 建立 ISO ==== * <pre><nowiki> sudo umount -l /dev/dvd sudo mount /dev/dvd </nowiki></pre> * <pre><nowiki> dd if=/dev/[device] of=file.iso bs=1024 </nowiki></pre> * <pre><nowiki> mkisofs -o file.iso [dir] </nowiki></pre> ==== MD5 校验 ==== * <pre><nowiki> md5sum file.iso > file.iso.md5 </nowiki></pre> * <pre><nowiki> md5sum -c file.iso.md5 </nowiki></pre> ==== 增加或者修改缺省的程序 ==== '''Quick explanation''': In order to associate an application (e.g., gThumb Image Viewer), with a file-type (e.g., PNG image files), the application needs to have a "desktop entry" (e.g., <code><nowiki>gthump.desktop</nowiki></code>) located in the <code><nowiki>/usr/share/applications/</nowiki></code> directory. Furthermore, the file-type needs to have a mime-type located in the <code><nowiki>/usr/share/mime/</nowiki></code> directory or one of its sub-directories (e.g., <code><nowiki>/usr/share/mime/images/png.xml</nowiki></code>). Finally, there should be a line in the <code><nowiki>/usr/share/applications/defaults.list</nowiki></code> file that associates the desktop entry with the mime-type (e.g., <code><nowiki>images/png=gthumb.desktop</nowiki></code>). * <pre><nowiki> sudo cp /usr/share/applications/defaults.list /usr/share/applications/defaults.list.backup </nowiki></pre> * <pre><nowiki> sudo gedit /usr/share/applications/defaults.list </nowiki></pre> <pre><nowiki> [mime-type]=[new-app].desktop </nowiki></pre> <pre><nowiki> ls /usr/share/applications/*.desktop </nowiki></pre> <pre><nowiki> ls /usr/share/applications/mime/[text|image|...] </nowiki></pre> * <pre><nowiki> killall gnome-panel killall nautilus </nowiki></pre> ==== 删除 occurences of ^M in Vim ==== * <pre><nowiki> :%s/^M$//g </nowiki></pre> * <pre><nowiki> :%s/^M/ /g </nowiki></pre> === SSH/Remote access === ==== 设置 SSH tunneling ==== ''See the [http://www.cs.cornell.edu/support/Connectivity/herakles/linux_setup.html CFS connectivity] page and this example [http://www.cs.cornell.edu/~djm/ubuntu/config ~/.ssh/config] file for information specific to CUCS tunneling.'' * <pre><nowiki> nano ~/.ssh/config </nowiki></pre> <pre><nowiki> host [bastion_hostname] user [bastion_username] hostname [bastion_hostname].[bastion_domain] ForwardAgent yes LocalForward 2001 [target_hostname].[target_domain]:22 host [target_hostname] user [target_username] hostname localhost port 2001 </nowiki></pre> * <pre><nowiki> ssh -f -N [bastion_hostname] </nowiki></pre> * <pre><nowiki> ssh [target_hostname] </nowiki></pre> * (optional) Set up [http://www.cs.cornell.edu/~djm/ubuntu/#ssh-public-key-authentication public key authentication]. ==== 设置 SSH public key authentication ==== * <pre><nowiki> ssh-keygen -f [key_file] -t dsa </nowiki></pre> * Append the contents of your <code><nowiki>[key_file].pub</nowiki></code> to the server's <code><nowiki>~/.ssh/authorized_keys2</nowiki></code> file. If you don't have access, email the server's admin. * <pre><nowiki> ssh -i [key_file] [server_name].[server_domain] </nowiki></pre> * <pre><nowiki> cp ~/.ssh/known_hosts ~/.ssh/known_hosts.backup ssh -N -f [bastion_hostname] ssh-keyscan -H -t rsa,dsa -p 2001 localhost >> ~/.ssh/known_hosts ssh-keyscan -H -t rsa,dsa -p 2002 localhost >> ~/.ssh/known_hosts ssh-keyscan -H -t rsa,dsa -p ... localhost >> ~/.ssh/known_hosts </nowiki></pre> * (optional) Set up [http://www.cs.cornell.edu/~djm/ubuntu/#ssh-key-management SSH key management] so that you only have to enter your passphrase once per session. ==== SSH key management ==== The following allows you to set things up so that you only have to enter your SSH key passphrase ''once per login session''. * <pre><nowiki> sudo apt-get install gnome-keyring-manager </nowiki></pre> * <pre><nowiki> ssh-add </nowiki></pre> * <pre><nowiki> ssh-add -D </nowiki></pre> ==== Reboot (remotely) from Ubuntu into Windows ==== NOTE: this assumes that you use GRUB to dual boot and that you do NOT use dmraid. * If you are rebooting a remote computer, first SSH into the remote computer, and then follow the next steps in the remote terminal. * <pre><nowiki> sudo nano /boot/grub/menu.lst </nowiki></pre> <pre><nowiki> default 0 </nowiki></pre> <pre><nowiki> default saved </nowiki></pre> * <pre><nowiki> sudo grub-reboot [number] </nowiki></pre> ==== Reboot (remotely) from Windows into Ubuntu ==== NOTE: this assumes that you use GRUB to dual boot, and that ''Ubuntu is the first boot option'' in <code><nowiki>/root/grub/menu.lst</nowiki></code>. * If you are rebooting a remote computer, first [http://www.cs.cornell.edu/~djm/ubuntu/#remote-desktop Remote-desktop into the remote computer], and then follow the next step in the remote desktop. * <pre><nowiki> shutdown /r /t 00 </nowiki></pre> ==== Remote desktop to your CUCS computer that is currently running Windows ==== NOTE: The remote computer must be currently booted in WinXP, so you might have to [http://www.cs.cornell.edu/~djm/ubuntu/#reboot-ubuntu-to-windows reboot remotely from Ubuntu to Windows] first. * [http://www.cs.cornell.edu/~djm/ubuntu/#ssh-tunneling Configure SSH tunneling for CUCS] using the example [http://www.cs.cornell.edu/~djm/ubuntu/config ~/.ssh/config] file. The following assumes that in SSH forwards <code><nowiki>localhost:2011</nowiki></code> to <code><nowiki>[CUCS_hostname].u.cs.cornell.edu:3389</nowiki></code> on lion (as per your <code><nowiki>~/.ssh/config</nowiki></code> file). * <pre><nowiki> ssh -N -f herakles ssh -N -f lion </nowiki></pre> * <pre><nowiki> rdesktop -r disk:sync=/home/[local_dir] localhost:2011 </nowiki></pre> ==== Access your CUCS home directories via Samba ==== NOTE: I find that using [http://www.cs.cornell.edu/~djm/ubuntu/#cucs-sftp SFTP] is faster and more reliable. See http://www.cs.cornell.edu/support/Linux/smbmount.htm for additional info. * [http://www.cs.cornell.edu/~djm/ubuntu/#ssh-tunneling Configure SSH tunneling for CUCS] using the example [http://www.cs.cornell.edu/~djm/ubuntu/config ~/.ssh/config] file. The following assumes that in SSH forwards <code><nowiki>localhost:2017</nowiki></code> to <code><nowiki>smb.cs.cornell.edu:139</nowiki></code> on lion (as per your <code><nowiki>~/.ssh/config</nowiki></code> file). * <pre><nowiki> ssh -N -f herakles ssh -N -f lion </nowiki></pre> * <pre><nowiki> smbclient //smb.cs.cornell.edu/win -U [username] -W CUCS -I localhost -p 2017 </nowiki></pre> <pre><nowiki> smbmount //smb.cs.cornell.edu/win [local_dir] -o ip=localhost,port=2017,username=[username],workgroup=CUCS </nowiki></pre> <pre><nowiki> smbumount [local_dir] </nowiki></pre> ==== Access your CUCS home directories via SFTP ==== I find this method faster and more reliable than using Samba. * [http://www.cs.cornell.edu/~djm/ubuntu/#ssh-tunneling Configure SSH tunneling for CUCS] using the example [http://www.cs.cornell.edu/~djm/ubuntu/config ~/.ssh/config] file. * <pre><nowiki> ssh -N -f herakles sftp lion </nowiki></pre> * <pre><nowiki> sftp://lion/home/[user] </nowiki></pre> <pre><nowiki> sftp://lion/home/WIN/[user] </nowiki></pre> <pre><nowiki> sftp://lion/home/BIGBOX/[user] </nowiki></pre> <pre><nowiki> sftp://lion/home/BIGBOX.win/[user] </nowiki></pre> * <pre><nowiki> \\cucs\home\UNIX\[user] </nowiki></pre> <pre><nowiki> \\cucs\home\Windows\[user] </nowiki></pre> <pre><nowiki> \\cs.cornell.edu\home\bigbox\[user] </nowiki></pre> ==== Send host-name to DHCP server ==== If you have trouble accessing your Ubuntu machine remotely, it might be because the DHCP server needs to be informed of the machine's name. * <pre><nowiki> sudo cp /etc/dhcp3/dhclient.conf /etc/dhcp3/dhclient.conf.backup sudo gedit /etc/dhcp3/dhclient.conf </nowiki></pre> <pre><nowiki> send "[hostname].[domain]"; </nowiki></pre> * Reboot the computer. ==== Restart the Gnome Desktop Manager (GDM) ==== * Close all open programs. * <pre><nowiki> sudo /etc/init.d/gdm restart </nowiki></pre> ==== Recursively remove files by name ==== * <pre><nowiki> find [dir] -name "*.monkeypoop" -ok rm {} \; </nowiki></pre> === Links === Most of the information on this page comes from the following sources: * [http://www.krazypenguin.net/Ubuntu_Dapper_Drake_6.06_Guide The Ubuntu Dapper Drake 6.06 Guide] * [http://help.ubuntu.com/starterguide/C/index.html The Official Ubuntu Start Guide] * [https://wiki.ubuntu.com/RestrictedFormats/ The Ubuntu Restricted Formats Wiki] * [http://www.ubuntuforums.org/ The Ubuntu Forums] You can visit my [http://www.cs.cornell.edu/~djm/ home page] to find out how to contact me with feedback and suggestions for this site.
返回至
Ubuntu6.06HowTo
。