Ubuntu 6.06 (Dapper Drake) How-To

Ubuntu

This page is not maintained anymore; the links may be broken, and the information may be out of date.

The information presented here is for you to use freely but at your own risk.

Installing Ubuntu

The links to screenshots in this section are from OSDir's screenshot gallery.

  1. Download the Dapper Drake installation CD/DVD image, and then burn the image to CD/DVD.
  2. Boot off the CD/DVD. This usually involves simply rebooting the computer with the CD/DVD in the appropriate drive. For some computers you may need to hit F12 (or F2, or DEL, or something like that) at the appropriate time during boot and select from a menu to boot off the CD.
  3. Choose the Start or install Ubuntu option.
  4. After the computer boots into the Live CD version of Ubuntu, double-click the Install icon.
  5. Choose the language; location and time-zone; keyboard layout; and user name, password, and computer name.
  6. When you reach the "Prepare disk space" section, choose to "Manually edit partition table". Note that you can decide to keep any existing Windows partition(s) (in which case Ubuntu will install itself with dual boot options). However, if the Windows partitions take up the whole hard drive, then you must first shrink these partition(s) in order to free up space for your Ubuntu partitions. I recommend setting up three new partitions for Ubuntu as follows:
    Purpose Size Filesystem
    swap space 1 - 2GB linux-swap
    root directory (/) 4 - 8GB reiserfs (or ext3)
    home directory (/home) remaining free space reiserfs (or ext3)
    The /home directory will hold your documents/music/etc., so plan to invest adequate space for that. Putting /home on a separate partition allows you to upgrade/reinstall the OS without affecting your documents.
  7. Review your choices, and then click "Install".
  8. Read a magazine, slay a vampire, or clip your toe-nails while Ubuntu installs.
  9. Eventually, you will be informed that the installation is complete, at which point click the "Restart now" button. Make sure to remove the CD/DVD so that the computer doesn't boot back into the Live CD.
  10. If Ubuntu detected Windows on another partition, it will present you with dual boot options using GRUB. The top option is Ubuntu. Choose it, or else just let the timer count down to zero.
  11. After the computer reboots into the newly installed Ubuntu, log in using the user name and password that you selected earlier during installation.
  12. Congratulations! You are now running Ubuntu! Wasn't that easy? :)

Initial setup

  1. Update and upgrade package sources
  2. Install nVidia graphics driver
  3. Enable 5-button mouse
  4. Enable CD/DVD eject
  5. Add extra repositories

Useful packages

Troubleshooting

Customization

Hardware

SSH/Remote access

Most of the information on this page comes from the following sources:

You can visit my home page to find out how to contact me with feedback and suggestions for this site.

Update and upgrade packages

  1. sudo apt-get update
    sudo apt-get upgrade
    

Install nVidia graphics driver

Note that installing the nVidia driver will automatically fix some screen resolution problems.

  1. Install the driver (only if you have an nVidia grapics card):
    sudo apt-get install nvidia-glx
    
  2. Enable the driver:
    sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup.nvidia
    sudo nvidia-glx-config enable
    
    If there was an error message, you might have to enable the driver manually as follows:
    sudo gedit /etc/X11/xorg.conf
    
    Replace:
    Section "Device"
    	...
    	Driver		"nv"
    	...
    EndSection
    
    with:
    Section "Device"
    	...
    	Driver		"nvidia"
    	...
    EndSection
    
  3. (optional) Create a desktop entry for nVidia Settings (accessed via the "Applications / System / nVidia Settings" menu):
    sudo gedit /usr/share/applications/nvidia-settings.desktop
    
    Add the following to the blank file:
    [Desktop Entry]
    Name=NVIDIA Settings
    Comment=nVidia Settings
    Exec=nvidia-settings
    Icon=
    Terminal=false
    Type=Application
    Categories=Application;System;
    
  4. (optional) Disable the nVidia splash screen:
    sudo gedit /etc/X11/xorg.conf
    
    Change:
    Section "Device"
    	Identifier	"NVIDIA Corporation ..."
    	...
    EndSection
    
    to:
    Section "Device"
    	Identifier	"NVIDIA Corporation ..."
    	...
    	Option		"NoLogo"	"true"
    EndSection
    
  5. (optional) Restart Gnome Desktop Manager for these settings to take effect.

Here is a script to do steps 1 - 4 automatically:

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"\t"true"@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

Enable 5-button mouse

  1. If you have a 5-button mouse, you can enable the forward and back buttons as follows:
    sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup.mouse
    sudo gedit /etc/X11/xorg.conf
    
    Change:
    Section "InputDevice"
    	Identifier	"Configured Mouse"
    	Driver		"mouse"
    	...
    	Option		"Protocol"		"ExplorerPS/2"
    	...
    	Option		"Emulate3Buttons"	"true"
    	...
    EndSection
    
    to:
    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
    
  2. (optional) Restart Gnome Desktop Manager for these settings to take effect.

Here is a script to do step 1 automatically:

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

Enable CD/DVD eject

  1. Enable CD/DVD eject for the current session:
    sudo sysctl dev.cdrom.lock=0
    
  2. Enable CD/DVD eject on startup for future sessions:
    sudo cp /etc/sysctl.conf /etc/sysctl.conf.backup.eject
    sudo gedit /etc/sysctl.conf
    
    Add the following line to the file:
    dev.cdrom.lock=0
    

Here is a script to do step 1 automatically:

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;

Add extra repositories

  1. sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
    
  2. sudo gedit /etc/apt/sources.list
    
    Add:
    ## OFFICIALLY SUPPORTED REPOSITORIES
    
    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
    
    
    ## COMMUNITY SUPPORTED REPOSITORIES
    
    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
    
    
    ## BACKPORTS
    
    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
    
    
    ## PENGUIN LIBERATION FRONT (PLF) REPOSITORIES (http://wiki.ubuntu-fr.org/doc/plf)
    
    ## Primary
    #deb http://packages.freecontrib.org/ubuntu/plf/ dapper free non-free
    #deb-src http://packages.freecontrib.org/ubuntu/plf/ dapper free non-free
    
    ## Secondary (use only if primary is not working)
    #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
    
  3. sudo apt-get update
    

Here is a script to do steps 1 - 3 automatically (requires internet access):

wget -c -O /tmp/sources.list http://www.cs.cornell.edu/~djm/ubuntu/sources_dapper.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

Install Microsoft fonts

  1. sudo apt-get install msttcorefonts
    

Install multimedia codecs and players

  1. Add extra repositories.
  2. (optional) Install DVD playback capability and Windows Media and RealPlayer codecs (see also the Restricted Formats page):
    wget -c -O /tmp/w32codecs.deb http://packages.freecontrib.org/ubuntu/plf/pool/dapper/non-free/w32codecs_20060611-1plf1_i386.deb
    wget -c -O /tmp/libdvdcss2.deb http://packages.freecontrib.org/ubuntu/plf/pool/dapper/free/libdvdcss2_1.2.9-1plf4_i386.deb 
    sudo dpkg -i /tmp/w32codecs.deb /tmp/libdvdcss2.deb
    
  3. (alternative) In case previous step didn't work, try the following:
    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
    
  4. Install some useful encoder/decoder/playback tools:
    sudo apt-get install lame sox ffmpeg mjpegtools mpg321 vorbis-tools
    
  5. (recommended) Install totem-xine (this is my favorite media player - it plays most media files, and has a very clean interface):
    sudo apt-get install totem-xine libxine-extracodecs
    
  6. (alternative) Install totem-gstreamer (this has the same user interface as totem-xine but uses different codecs; it cannot co-exist with totem-xine, which will automatically be uninstalled when totem-gstreamer is installed):
    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
    
  7. (optional) Add right-click options in Nautilus for enqueuing and replacing multiple files in Totem.
    1. Install Nautilus Actions (the universe repositories need to be enabled):
      sudo apt-get install nautilus-actions
      
    2. Run Nautilus Actions:
      nautilus-actions-config
      
    3. Add an action (for enqueuing media files in Totem) with the following properties:
      • Under the Menu Item & Action tab:
        • Label: Enqueue in Totem
        • Icon: /usr/share/pixmaps/media-player-48.png
        • Path: totem --enqueue
        • Parameters: %M
      • Under the Conditions tab:
        • Filenames: *
        • Match case: checked
        • Mimetypes:
          application/x-cd-image ; application/ogg ; application/vnd.rn-realmedia ; application/x-extension-m4a ; application/x-extension-mp4 ; application/x-flac ; application/x-matroska ; application/x-ogg ; application/x-shockwave-flash ; audio/mpeg ; audio/mpegurl ; audio/vnd.rn-realaudio ; audio/x-flac ; audio/x-m4a ; audio/x-mp3 ; audio/x-mpeg ; audio/x-mpegurl ; audio/x-ms-asf ; audio/x-ms-asx ; audio/x-ms-wax ; audio/x-ms-wma ; audio/x-pn-aiff ; audio/x-pn-au ; audio/x-pn-realaudio-plugin ; audio/x-pn-realaudio ; audio/x-pn-wav ; audio/x-pn-windows-acm ; audio/x-real-audio ; audio/x-vorbis+ogg ; audio/x-wav ; image/vnd.rn-realpix ; misc/ultravox ; video/dv ; video/mp4 ; video/mpeg ; video/msvideo ; video/quicktime ; video/vnd.rn-realvideo ; video/x-anim ; video/x-avi ; video/x-flc ; video/x-fli ; video/x-mpeg ; video/x-ms-asf ; video/x-msvideo ; video/x-ms-wmv ; video/x-nsv
          
        • Appears if selection contains: Only files
        • Appears if selection has multiples files or folders: checked
    4. Add an action (for replacing media files in Totem) with the same properties as in the previous step, except for the following:
      • Under the Menu Item & Action tab:
        • Label: Replace in Totem
        • Path: totem --replace
        • Parameters: %M
  8. (recommended) Install MPlayer (a media player that plays pretty much everything, but has a lousy interface; it's good to have around for the rare cases when totem-xine can't play something):
    sudo apt-get install mplayer
    sudo sed -i.backup -e's@vo=x11,@vo=xv,@g' /etc/mplayer/mplayer.conf 
    
  9. (recommended) Install mplayer plugin for Firefox:
    sudo apt-get install mozilla-mplayer
    

Install TiMidity (MIDI player/software synthesizer)

(See also the Midi Software Synthesis How-To.)

  1. Install Timidity:
    sudo apt-get install timidity timidity-interfaces-extra
    
  2. (optional) Start software synthesis by loading the appropriate modules and starting Timidity as the MIDI server:
    sudo modprobe snd-seq-device
    sudo modprobe snd-seq-midi
    sudo modprobe snd-seq-oss
    sudo modprobe snd-seq-midi-event
    sudo modprobe snd-seq
    timidity -iA -B2,8 -Os1l -s 44100
    
    To make software synthesis start automatically in future, first make the appropriate modules load automatically:
    sudo gedit /etc/modules
    
    Append the following:
    snd-seq-device
    snd-seq-midi
    snd-seq-oss
    snd-seq-midi-event
    snd-seq
    
    Then inform Timidity to start automatically:
    sudo gedit /etc/default/timidity
    
    Uncomment the line to enable the sequencer. That is, change:
    #TIM_ALSASEQ=true
    
    to:
    TIM_ALSASEQ=true
    
  3. Add a desktop entry for Timidity:
    sudo gedit /usr/share/applications/timidity.desktop
    
    Add:
    [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
    
  4. (optional) Make Timidity the default MIDI player (after first having added a desktop entry as in the previous step):
    sudo cp /usr/share/applications/defaults.list /usr/share/applications/defaults.list.backup.midi
    sudo gedit /usr/share/applications/defaults.list
    
    Insert/replace the audio/midi entry as follows:
    audio/midi=timidity.desktop
    
  5. (optional) Install high quality sound fonts:
    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
    
    Change:
    source /etc/timidity/freepats.cfg
    
    to:
    source /usr/share/doc/timidity-patches-eaw/examples/timidity.cfg
    
  6. (optional) Reduce Timidity's CPU usage:
    sudo gedit /etc/timidity/timidity.cfg
    
    Add:
    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
    
    Save and close the file.

Here is a script to do steps 1 - 5 for automatically:

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
sudo modprobe snd-seq-device
sudo modprobe snd-seq-midi
sudo modprobe snd-seq-oss
sudo modprobe snd-seq-midi-event
sudo modprobe snd-seq
timidity -iA -B2,8 -Os1l -s 44100
(printf 'snd-seq-device\nsnd-seq-midi\nsnd-seq-oss\nsnd-seq-midi-event\nsnd-seq\n') | sudo tee -a /etc/modules
sudo sed -i -e's@#TIM_ALSASEQ=true@TIM_ALSASEQ=true@g' /etc/default/timidity

Install GParted (disk partition utility)

  1. sudo apt-get install gparted
    

Install Mozilla Thunderbird (email client)

  1. sudo apt-get install mozilla-thunderbird
    
  2. (optional) See how to restore Mozilla Firefox and Thunderbird icons.

Install GnomeBaker (CD burner)

  1. sudo apt-get install gnomebaker
    

Install Sound Juicer (audio CD ripper)

  1. sudo apt-get install sound-juicer
    

Install Acroread (PDF viewer)

  1. sudo apt-get install acroread
    
  2. (optional) Make Acroread the default pdf viewer by changing the application/pdf entry of /usr/share/applications/defaults.list:
    sudo sed -i.backup.acroread -e's@application/pdf=evince.desktop@application/pdf=AdobeReader.desktop@g' /usr/share/applications/defaults.list
    
  3. (optional) Install Acroread plugin for Firefox:
    sudo apt-get install mozilla-acroread
    

Install Flash player plugin for Firefox

  1. sudo apt-get install flashplugin-nonfree
    sudo update-flashplugin
    

Install Sun Java

(See the Restricted Formats page.)

  1. sudo apt-get install sun-java5-jre sun-java5-plugin
    sudo update-alternatives --config java
    
    Select the sun java option.

Install teTeX (LaTeX)

  1. sudo apt-get install tetex-base tetex-bin tetex-extra
    
  2. Here is a sample LaTeX file and the makefile to compile it with.

Install Octave (Matlab replacement)

  1. sudo apt-get install octave
    

Install Gnuplot (plotting/graphing utility)

  1. sudo apt-get install gnuplot
    

Install Development Tools

  1. Basic compilers and tools:
    sudo apt-get install build-essential manpages-dev
    
  2. (optional) GNU multi-precision arithmetic library:
    sudo apt-get install libgmp3-dev libgmp3-doc
    
  3. (optional) OpenGL and SDL development:
    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
    
    Note that in order to get compile with FTGL, you might need to do the following:
    sudo ln -s /usr/include/freetype2/freetype /usr/include/freetype
    

Install CVS (version control system)

  1. sudo apt-get install cvs
    
  2. (recommended) Install TkCVS, a GUI front-end for CVS:
    sudo apt-get install tkcvs
    

Install GVim (editor)

  1. sudo apt-get install vim-gnome
    
  2. (optional) Tinker with your ~/.vimrc file to your heart's content. (See my ~/.vimrc for an example.)
  3. (optional) Make gvim the default text editor:
    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 
    

Install jEdit (editor)

  1. Install Java.
  2. Add the jEdit repository to your etc/apt/sources.list file:
    sudo gedit /etc/apt/sources.list
    
    Add the following lines:
    deb http://dl.sourceforge.net/sourceforge/jedit ./
    deb-src http://dl.sourceforge.net/sourceforge/jedit ./
    
    Save and close the file.
  3. Install jEdit:
    sudo apt-get update
    sudo apt-get install jedit
    
  4. (optional) Make jEdit reuse windows when opening files to edit.
    sudo gedit /usr/bin/jedit
    
    Change:
    ... ${JEDIT} -jar "/usr/share/jedit/jedit.jar" $@
    
    to:
    ... ${JEDIT} -jar "/usr/share/jedit/jedit.jar" -reuseview $@
    

Install Games (ScummVM)

  1. sudo apt-get install supertux scummvm
    sudo apt-get install beneath-a-steel-sky flight-of-the-amazon-queen
    

Install OpenSSH (SSH server)

  1. sudo apt-get install openssh-server
    
  2. You might also need to send your host-name to your DHCP server.

Mount

  1. ReiserFS partition:
    sudo mount /dev/hdb1 [mount_point_dir] -t reiserfs -o notail
    
  2. EXT3 partition:
    sudo mount /dev/hdb1 [mount_point_dir] -t ext3 
    
  3. NTFS partition:
    sudo mount /dev/hda1 [mount_point_dir] -t ntfs -o nls=utf8,umask=0222
    
  4. FAT32 partition:
    sudo mount /dev/hda1 [mount_point_dir] -t vfat -o iocharset=utf8,umask=000
    
  5. CD/DVD:
    sudo mount /media/cdrom0/ -o unhide
    
  6. ISO:
    sudo modprobe loop
    sudo mount file.iso /media/iso/ -t iso9660 -o loop -r
    

Unmount

  1. sudo umount [mount_point_dir]
    
  2. Force unmount (if previous step doesn't work):
    sudo umount -l [mount_point_dir]
    

Create ISO

  1. Create an ISO from CD/DVD (replace [device] with dvd, cdrom, or cdrom1):
    dd if=/dev/[device] of=file.iso bs=1024
    
    If this step fails with an "input/output error", try various combinations of unmounting/remounting/ejecting the device:
    sudo umount -l /dev/[device]
    eject /dev[device]
    sudo mount /dev/[device]
    
  2. Create an ISO from a directory:
    mkisofs -o file.iso [dir]
    

MD5 Checksum

  1. Create:
    md5sum file.iso > file.iso.md5
    
  2. Verify:
    md5sum -c file.iso.md5
    

Fix sound

See the Unofficial Ubuntu Starter Guide for more information.

Fix screen resolution

See https://wiki.ubuntu.com/FixVideoResolutionHowto for more information. The following worked for me:

  1. Check that /etc/X11/xorg.conf contains the correct HorizSync and VertRefresh options in the "Monitor" section as follows.
    sudo ddcprobe | grep monitorrange
    
    The first two values returned are your HorizSync rates, the second pair is your VertRefresh values.
    sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup.sync_and_refresh
    sudo gedit /etc/X11/xorg.conf
    
    Find the following section and make sure the HorizSync and VertRefresh lines exist and have the appropriate values (e.g., 30-96 and 50-160):
    Section "Monitor"
                ...
                HorizSync          30-96
                VertRefresh        50-160
    EndSection
    

Fix Xine's WMV playback

  1. To fix Xine's WMV playback (only if it is broken):
    cp ~/.xine/catalog.cache ~/.xine/catalog.cache.backup
    gedit ~/.xine/catalog.cache
    
    Find the following section:
    [/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
    
    Replace (in this section only):
    decoder_priority=1
    With:
    decoder_priority=7

Fix jumpy/skipping/choppy/stuttering CD/DVD playback

See the Unofficial Ubuntu Starter Guide for more information.

  1. Check if DMA is enabled for the appropriate CD/DVD device:
    sudo hdparm -d /dev/[device]
    
    where [device] is cdrom, cdrom1, cdrw, dvd, etc.
  2. If DMA was off for the device, enable it:
    sudo hdparm -d1 /dev/[device]
    sudo cp /etc/hdparm.conf /etc/hdparm.conf.backup.dma
    sudo gedit /etc/hdparm.conf
    
    Append the following to the /etc/hdparm.conf
    /dev/[device] {
           dma = on
    }
    
    where [device] is cdrom, cdrom1, cdrw, dvd, etc.

Fix "There are differences between boot sector and its backup" error

  1. This is not a fix, but a way to avoid the warning:
    sudo gedit /etc/fstab
    
    Replace:
    /dev/hda1 /media/hda1 vfat defaults,utf8,umask=007,gid=46 0 1
    
    With:
    /dev/hda1 /media/hda1 vfat iocharset=utf8,umask=000 0 0
    
    Note that occurences of hda1 could be different (e.g., hdb2) for you, depending on the disk and partition number of your FAT32 partition.

Set up SSH tunneling

See CFS's "Connecting to Herakles using SSH" page and this example ~/.ssh/config file for information specific to CUCS tunneling.

  1. Set up tunneling to [target_hostname].[target_domain] via [bastion_hostname].[bastion_domain] using port local forwarding on port 2001:
    nano ~/.ssh/config
    
    Add:
    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
    
  2. Start tunneling:
    ssh -f -N [bastion_hostname]
    
  3. SSH to target:
    ssh [target_hostname]
    
  4. (optional) Set up public key authentication.

Set up SSH public key authentication

  1. Create a private/public key pair on your client:
    ssh-keygen -f [key_file] -t dsa
    
    I highly recommend using a non-empty passphrase; you can later set up key management so that you only enter your passphrase once per session.
  2. Append the contents of your [key_file].pub to the server's ~/.ssh/authorized_keys2 file. If you don't have access, email the server's admin.
  3. SSH to server:
    ssh -i [key_file] [server_name].[server_domain]
    
  4. (optional) If you use SSH tunneling and public key authentication with multiple SSH servers, then you will probably run into a "HOST IDENTIFICATION HAS CHANGED" warning. This is because multiple servers are associated with a single hostname (namely, localhost) through the use of port forwarding. You can resolve this issue as follows (assuming port forwarding for the different target servers are on ports 2001, 2002, ...):
    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
    
  5. (optional) Set up 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.

  1. sudo apt-get install gnome-keyring-manager
    
  2. Activate your keys for the remainder of the session (you'll be prompted for your passphrase):
    ssh-add
    
  3. Deactivate your keys:
    ssh-add -D
    

Reboot (remotely) from Ubuntu into Windows

NOTE: this assumes that you use GRUB to dual boot and that you do NOT use dmraid.

  1. If you are rebooting a remote computer, first SSH into the remote computer, and then follow the next steps in the remote terminal.
  2. This step needs to be done only once (and apparently you should NOT do it if you are using dmraid) - you don't have to do this step for subsequent reboots.
    sudo nano /boot/grub/menu.lst
    
    Change:
    default		0
    
    to:
    default		saved
    
    Save and close the file by hitting [CTRL]+[o] and then [CTRL]+[x].
  3. Reboot the machine using the appropriate GRUB entry:
    sudo grub-reboot [number]
    
    where [number] is the number of lines that show up in your GRUB menu before the "Windows" line (typically 4, 6, or 8). (Don't include the "Windows" line into your count, but do include the "Other operating systems:" line.) For example, [number] is 4 in this screenshot because there are four lines above the "Windows" option.

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 /root/grub/menu.lst.

  1. If you are rebooting a remote computer, first Remote-desktop into the remote computer, and then follow the next step in the remote desktop.
  2. Click "Start / Run..." and enter:
    shutdown /r /t 00
    

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 reboot remotely from Ubuntu to Windows first.

  1. Configure SSH tunneling for CUCS using the example ~/.ssh/config file. The following assumes that in SSH forwards localhost:2011 to [CUCS_hostname].u.cs.cornell.edu:3389 on lion (as per your ~/.ssh/config file).
  2. ssh -N -f herakles
    ssh -N -f lion
    
  3. rdesktop -r disk:sync=/home/[local_dir] localhost:2011
    
    Note that disk:sync should be set to an absolute (as opposed to relative) path.

Access your CUCS home directories via Samba

NOTE: I find that using SFTP is faster and more reliable.

See CFS's "Samba mounting" page for additional info.

  1. Configure SSH tunneling for CUCS using the example ~/.ssh/config file. The following assumes that in SSH forwards localhost:2017 to smb.cs.cornell.edu:139 on lion (as per your ~/.ssh/config file).
  2. ssh -N -f herakles
    ssh -N -f lion
    
  3. You can now use either smbclient, which provides an ftp like console:
    smbclient //smb.cs.cornell.edu/win -U [username] -W CUCS -I localhost -p 2017
    
    Or smbmount to mount the share:
    smbmount //smb.cs.cornell.edu/win [local_dir] -o ip=localhost,port=2017,username=[username],workgroup=CUCS
    
    And smbumount to unmount it:
    smbumount [local_dir]
    

Access your CUCS home directories via SFTP

I find this method faster and more reliable than using Samba.

  1. Configure SSH tunneling for CUCS using the example ~/.ssh/config file.
  2. ssh -N -f herakles
    sftp lion
    
  3. For SFTP access via Nautilus, open Nautilus and press [CTRL]+L and enter one of the following addresses:

    Linux home directory:
    sftp://lion/home/[user]
    
    Windows home directory:
    sftp://lion/home/WIN/[user]
    
    Linux Bigbox directory:
    sftp://lion/home/BIGBOX/[user]
    
    Windows Bigbox directory:
    sftp://lion/home/BIGBOX.win/[user]
    
  4. For the sake of completeness, the locations of these directories under Windows are:

    Linux home directory:
    \\cucs\home\UNIX\[user]
    
    Windows home directory:
    \\cucs\home\Windows\[user]
    
    Windows Bigbox directory:
    \\cs.cornell.edu\home\bigbox\[user]
    

Rename your computer

  1. Run the following, and then choose the "General" tab, and change the hostname as desired:
    gksudo network-admin
    
  2. (optional) If you access your computer remotely, you might need to tell your DHCP server your host-name.

Customize theme and fonts

  1. gnome-theme-manager
    
    Click "Theme Details", and fiddle away. My preferences are "Controls = Silicon, Window Border = Silicon, Icons = Tangerine".
  2. gnome-font-properties
    
    My preferences are "App = Sans 8, Desktop = Sans 8, Window title = Sans 8, Terminal = Monospace 10".

Relocating the /home directory

IMPORTANT: This only applies if you want to move your home directory to another drive, or if you want to activate an existing home directory on another drive.

  1. (NOTE: Skip this first step if you already have your home directory on the partition you want, e.g., if you've already done this step during a previous installation.) Copy your current home directory onto the new drive:
    sudo mkdir /media/new
    
    Now mount the new partition (e.g., /dev/hdb2) to . If it is an Ext3 partition, use the following:
    sudo mount -t ext3 /dev/hdb1 /mnt/new/
    
    If it is a ReiserFS partition, use the following:
    sudo mount -t reiserfs -o notail /dev/hdb1 /mnt/new/
    
    Now copy your existing home directory to the new partition.
    sudo cp -R -p /home/[user] /mnt/new/
    sudo chown [user]:[user] /mnt/new/[user]
    sudo umount /mnt/new/
    
  2. Mount the new drive as /home:
    sudo nano /etc/fstab
    
    Assuming your intended home partition is /dev/hdb1, add a line to your /etc/fstab file to automount the partition onto the /home directory. If your intended home partition is Ext3, add the following line just after the main and swap partitions:
    /dev/hdb1 /home ext3 defaults,errors=remount-ro 0 2
    
    If the intended home partition is ReiserFS, use the following:
    /dev/hdb1 /home reiserfs defaults,notail 0 2
    
    Save the file (i.e., press [CTRL]+[o]) and exit Nano (i.e., press [CTRL]+[x]).
  3. Restart Gnome Desktop Manager.

Disable USplash

  1. (optional) To disable USplash, if, like me, you find it ugly:
    sudo cp /boot/grub/menu.lst /boot/grub/menu.lst.backup
    sudo gedit /boot/grub/menu.lst
    
    Remove the splash option from the appropriate lines. I.e., Change:
    kernel          /boot/... root=... ro quiet splash
    
    to:
    kernel          /boot/... root=... ro quiet
    

Restore Mozilla Firefox and Thunderbird icons

  1. Firefox:
    wget -c -O /tmp/mozilla-firefox.png http://www.cs.cornell.edu/~djm/ubuntu/mozilla-icons/mozilla-firefox.png
    wget -c -O /tmp/document.png http://www.cs.cornell.edu/~djm/ubuntu/mozilla-icons/document.png
    chmod 644 /tmp/mozilla-firefox.png /tmp/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 /tmp/mozilla-firefox.png /usr/share/pixmaps/mozilla-firefox.png
    sudo cp /tmp/mozilla-firefox.png /usr/share/pixmaps/mozilla-firefox.xpm
    sudo cp /tmp/mozilla-firefox.png /usr/lib/mozilla-firefox/icons/default.xpm
    sudo cp /tmp/document.png /usr/lib/mozilla-firefox/icons/document.png
    sudo cp /tmp/mozilla-firefox.png /usr/lib/mozilla-firefox/chrome/icons/default/default.xpm
    
  2. Thunderbird:
    wget -c -O /tmp/mozilla-thunderbird.xpm http://www.cs.cornell.edu/~djm/ubuntu/mozilla-icons/mozilla-thunderbird.xpm
    chmod 644 /tmp/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 /tmp/mozilla-thunderbird.xpm /usr/share/pixmaps/mozilla-thunderbird.xpm
    sudo cp /tmp/mozilla-thunderbird.xpm /usr/share/pixmaps/mozilla-thunderbird-menu.xpm
    sudo cp /tmp/mozilla-thunderbird.xpm /usr/share/pixmaps/mozilla-thunderbird-pm-menu.xpm
    sudo cp /tmp/mozilla-thunderbird.xpm /usr/lib/mozilla-thunderbird/chrome/icons/default/mozilla-thunderbird.xpm
    sudo cp /tmp/mozilla-thunderbird.xpm /usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow16.xpm
    sudo cp /tmp/mozilla-thunderbird.xpm /usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow.xpm
    sudo cp /tmp/mozilla-thunderbird.xpm /usr/lib/mozilla-thunderbird/chrome/icons/default/default.xpm
    

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.

  1. sudo cp /etc/dhcp3/dhclient.conf /etc/dhcp3/dhclient.conf.backup
    sudo gedit /etc/dhcp3/dhclient.conf
    
    Add the following line to the file:
    send "[hostname].[domain]";
    
    where [hostname] is your computer name and [domain] is the your computer's network domain (e.g., u.cs.cornell.edu).
  2. Reboot the computer.

Restart the Gnome Desktop Manager (GDM)

  1. Close all open programs.
  2. Either press [CTRL]+[ALT]+[BACKSPACE] or run:
    sudo /etc/init.d/gdm restart
    

Recursively remove files by name

  1. To remove *.monkeypoop from [dir] recursively:
    find [dir] -name "*.monkeypoop" -ok rm '{}' \;
    

Rename multiple files

  1. The following script will change all occurences of string1 in file names to string1:
    #!/bin/bash
    find -maxdepth 1 -name "*string1*" | while read file
    do
        target=$(echo $file | sed -e "s@string1@string2@g")
        mv "$file" "$target"
    done 
    
  2. The following script will change all upper-case letters in file names to lower-case:
    #!/bin/bash
    find -maxdepth 1 -name "*[A-Z]*" | while read file
    do
        target=$(echo $file | tr '[A-Z]' '[a-z]')
        mv "$file" "$target"
    done 
    
  3. Remember to make your script file executable:
    chmod +x [script_file]
    

Add or change a default application

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., gthump.desktop) located in the /usr/share/applications/ directory. Furthermore, the file-type needs to have a mime-type located in the /usr/share/mime/ directory or one of its sub-directories (e.g., /usr/share/mime/images/png.xml). Finally, there should be a line in the /usr/share/applications/defaults.list file that associates the desktop entry with the mime-type (e.g., images/png=gthumb.desktop).

  1. sudo cp /usr/share/applications/defaults.list /usr/share/applications/defaults.list.backup
    
  2. sudo gedit /usr/share/applications/defaults.list
    
    Add/change appropriate line to:
    [mime-type]=[new-app].desktop
    
    To figure out what [new-app] should be (if necessary):
    ls /usr/share/applications/*.desktop
    
    To figure out what [mime-type] should be (if necessary):
    ls /usr/share/applications/mime/[text|image|...]
    
  3. Restart Nautilus and the Gnome Panel:
    killall gnome-panel
    killall nautilus
    

Remove occurences of ^M in Vim

  1. In vim, replace all extraneous ^M by:
    :%s/^M$//g
    
    IMPORTANT: Make the ^M by typing "[CTRL]-V [CTRL]-M", not by "[CARROT] M"! This expression will replace all the ^M's that have carriage returns after them with nothing. (The dollar ties the search to the end of a line)
  2. In vim, replace all ^M's that need to have carriage returns:
    :%s/^M/ /g
    
    IMPORTANT: Make the ^M by typing "[CTRL]-V [CTRL]-M", not by "[CARROT] M"! This expression will replace all the ^M's that didn't have carriage returns after them with a carriage return.