My Ubuntu Manual

Save $200 using Linux instead of Windows!

Getting Started

Versions

  • Ubuntu 10.04 = Lucid
  • Ubuntu 9.10 = Karmic
  • Ubuntu 9.04 = Jaunty
  • Ubuntu 8.10 = Intrepid
  • Ubuntu 8.04 = Hardy
  • Ubuntu 7.10 = Gutsy
  • Ubuntu 7.04 = Feisty
  • Ubuntu 6.10 = Edgy
  • Ubuntu 6.06 = Dapper
  • Ubuntu 5.10 = Breezy
  • Ubuntu 5.04 = Hoary
  • Ubuntu 4.10 = Warty

Resize Windows partition to give more space for Ubuntu

There are several live CD distros out there that have gparted with a GUI interface, or tools such as Parted Magic.

Before resizing partitions, you might make things easier by booting Windows and using its built-in tools to reduce the size of its page file and to defragment its partition.

Shrinking an NTFS partition is a lot easier when that partition has been defragmented.

Installing Ubuntu 10.4 (Lucid)

Boot

To install Ubuntu, boot with the CD "Ubuntu 10.04 Desktop i386". Choose "Start or install Ubuntu".

Wait for the system to be ready.

Click on the "Install" icon, which will ask for:

  1. the language used for the installation process;
  2. your location;
  3. your keyboard layout;
  4. how to partition the disk;
  5. which documents and settings to migrate;
  6. your name, login and password and the name of your computer.

It's then ready to install!

Prepare your partitions

"Manually edit partition table" launches the Partition Editor gparted.

  • Delete all the old partitions (are you really, really sure?).
  • Create at least 2 new partitions:
    • ext4 for the / mount point, and
    • a linux-swap.

512 MB swap should be enough for any desktop system with 512 MB RAM or more.

Consider adding more swap if you are running applications that really require much memory, like VMware for instance. 2 GB is more than generous for a swap partition, then.

Here, I have:

  • a swap partition of 2048 MB (sda1),
  • a reiserfs partition of 91053 MB (sda3) for the / mount point, and
  • a reiserfs partition of 5453 MB (sda4) for the /var mount point.
# sudo fdisk -l

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x67224d98

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         249     2000061   82  Linux swap / Solaris
/dev/sda2   *         913        3523    20972857+   7  HPFS/NTFS
/dev/sda3            3524       14593    88919775   83  Linux
/dev/sda4             250         912     5325547+  83  Linux

Dmesg

Search for hints in the dmesg output, like "try …".

Video Drivers

Go to "Administration" -> "Hardware Drivers". Activate the driver "NVIDIA accelerated graphics driver (version 185) [Recommended]", and restart the PC.

Go to "Preferences" -> "Display".

"It appears that your graphics driver does not support the necessary extensions to use this tool. Do you want to use your graphics driver vendor's tool instead?" Yes. NVIDIA Xserver settings.

Shell

sudo aptitude install bash-doc
sudo aptitude install rxvt-unicode

Get zsh to replace bash by default

sudo aptitude install zsh zsh-doc
chsh -s /bin/zsh <username>

Check that you username is associated with zsh:

grep <username> /etc/passwd

Procedure for Cygwin:

  • Install the zsh package
  • Stop all cygwin processes.
  • From command prompt, start ash: ash
  • Run the following command: PATH=/bin rebaseall -v

Adobe Flash Player

sudo aptitude install flashplugin-nonfree

Multimedia Codecs

Install the "restricted extras" package:

sudo aptitude install ubuntu-restricted-extras

To play DVDs, you also need to install libdvdcss2:

sudo aptitude install libdvdcss2

Restore configuration files

sudo aptitude install subversion

cd ~

# rename the bash skeleton files (otherwise they conflict with my version'ed
# ones)
mv .bashrc .bashr.orig
mv .bashrc_logout .bashrc_logout.orig

# rename the Public folder (that I'm using in my versioning)
mv Public/ Public.orig

svn co http://svn:81/svn/users/fni/MundaneumHome/trunk/ .

Note - Don't get the bad idea of putting the .subversion directory itself as well in SVN, even if you customized some of its files…

Hardware

Remember these.

Find your IDE chipset

# lspci | grep 'IDE'

00:1f.1 IDE interface: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) IDE Controller (rev 03)
00:1f.2 IDE interface: Intel Corporation 82801FBM (ICH6M) SATA Controller (rev 03)

Find your wireless chipset

# dmesg | grep ipw

ipw2200: Intel(R) PRO/Wireless 2200/2915 Network Driver, 1.2.0kmprq
ipw2200: Copyright(c) 2003-2006 Intel Corporation
ipw2200: Detected Intel PRO/Wireless 2200BG Network Connection
ipw2200: Detected geography ZZD (13 802.11bg channels, 0 802.11a channels)

Sound with HDA Intel (Alsa mixer)

WARNING!!! Some channels for the ALSA driver are muted by default:

Master          81
Headphone     81<>81
PCM          100<>100
Front         81<>81
Front Mic      0<>0  (muted)
Line-in        0<>0  (muted)
CD            80<>80
Mic            0<>0  (muted)
PC Speaker    54<>54 (muted)
Mono             0   (muted)

You would use ALSA mixer to set the appropriate volume.

from lsmod cat /proc/asound/cards cat /proc/asound/modules

Preferences and Administration

Double click

In Kubuntu, to enable double-click (instead of single-click): Go to "Kmenu" -> "System Settings" -> "Keyboard & Mouse" and click on "Mouse" in the left hand menu, and then choose "Double-click to open files and folders - select icons on first click".

Power Management

When closing the lid of my laptop, I expect my computer to go into standby automatically (called suspend in Ubuntu), which means it shuts down all other hardware but the RAM. When reopening the lid, the computer is therefore ready for use almost instantly.

http://friendlylinux.org/wp-content/photos2/ubuntu704mac/apm.jpg

Installing fonts

Installed via Automatix.

Installing Vista Fonts in Ubuntu

Installing Lucida TrueType fonts

sudo aptitude install sun-java6-fonts

"Well known" user directories

Just edit ~/.config/user-dirs.dirs to change the defaults. For example:

XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Desktop"
XDG_TEMPLATES_DIR="$HOME/Personal/Templates"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/Media/Documents"
XDG_MUSIC_DIR="$HOME/Media/Music"
XDG_PICTURES_DIR="$HOME/Media/Pictures"
XDG_VIDEOS_DIR="$HOME/Media/Videos"

Places menu

You can modify or add new entries that will automatically appear in the "Places" menu by editing the ~/.gtk-bookmarks file:

file:///home/sva/Documents
file:///home/sva/Music
file:///home/sva/Pictures
file:///home/sva/Videos
smb://russell/backup/manbck/fni/MUNDANEUM/home/sva sva
smb://frege/d$/Users/Mvb Mvb
smb://192.168.2.16/backups/ backups on 192.168.2.16
smb://192.168.2.16/music/ music on 192.168.2.16
smb://192.168.2.16/activefolders/ activefolders on 192.168.2.16
smb://192.168.2.16/movies/ movies on 192.168.2.16
smb://192.168.2.16/photos/ photos on 192.168.2.16
smb://192.168.2.16/public/ public on 192.168.2.16

Writable shared folder with Samba

VirtualBox offers the option to access folders of your host from within your guest system, what is called shared folders. Although it is working most of the time, it has a slow transfer rate.

An alternative way to access shared folders between guest and host systems, is to completely by pass the built-in shared folders facility of VirtualBox, and use SMB/CIFS directly over a private network connection between the host and guest system.

See how to add a writeable shared folder with Samba on Ubuntu.

Seeing startup messages at boot time

If you want to enable the scrolling list of startup steps below the Ubuntu logo, edit the file /boot/grub/menu.lst: leave splash, but remove the keyword quiet for those kernels where you would like to see visual feedback.

See The Linux BootPrompt-HowTo for more information about all the possible boot time arguments.

Date & Time

Right-click on the Date and Time widget, choose Settings and set the configuration to "Keep synchronized with Internet servers". If NTP support is not yet install, you will be asked to install it.

Alternatively, type the following command:

sudo aptitude install ntpdate

You can confirm that ntp is working fine by running a few of the commands that are described in the NTP Toolkit.

Keyboard

Keyboard Indicator

Add the Keyboard Indicator applet to your panel:

  • Right-click on an empty space on the panel where you want to add the applet
  • Click "Add to Panel…"
  • Choose "Keyboard Indicator" from the "Utilities" section
  • You can now right-click on the "Keyboard Indicator" to manage your keyboard layouts.

Optionally change the shortcut used to switch the keyboard layout, by choosing another option in the "Keyboard Preferences" menu -> "Layout Options" -> "Group Shift/Lock behavior".

Shortcuts

  • Common keys

    Go to "System" menu -> "Preferences" -> "Keyboard Shortcuts" to find the keyboard shortcut editor. Many of the common multimedia & control keys should be predefined, and if they aren't you should be able to assign functions to them through "Keyboard Shortcuts" very easily.

  • Bind commands to keys

    Launch gconf-editor (from the menu under "Applications" -> "System Tools" -> "Configuration Editor").

    Go under apps/metacity in gconf-editor. You will see among others:

    • global_keybindings and
    • keybinding_commands.

    If you click on global_keybindings, on the right pane, you can assign some entries for run_command_1 and so on, like:

    • <Super>e !!,
    • <Super>g,
    • <Super>r !!,
    • <Super>w,
    • etc.

    These have to be filled up with the relevant keysym for your key (like: XF86Play, XF86MyComputer, etc). Use xev to see.

    Then you can assign the matching command (or script) under keybinding_commands, like:

    • nautilus,
    • emacs,
    • konsole,
    • firefox,
    • etc.

Emacs key-bindings

This should add Emacs key-bindings to a solid number of applications:

  • M-! gconf-editor <RET>
  • Navigate to "Desktop" -> "Gnome" -> "Interface"
  • Double-click on gtk_key_theme and
  • Set it to the value Emacs

Gnome Terminal shortcuts

To edit the keyboard shortcuts for the gnome terminal, open the "Edit" -> "Keyboard Shortcuts" menu, and remap copy to Ctrl-C (for example) and paste to Ctrl-V.

Printers

How to install a new printer?

sudo aptitude install cupsys cupsys-client foomatic-filters

To manually add a network printer (bypassing Samba), just navigate with your web browser to your local CUPS (http://localhost:631, by default) and:

  • "Add a Printer"
  • "Name" it: "C510"
  • Select the "Device": "LPD/LPR Host or Printer"
  • Select the "Device URI": e.g. "lpd://10.10.10.248/ps"
  • Select the "Make": "Generic"
  • Select the "Model": "Generic PostScript Printer Foomatic/Postscript (recommended) (en)"

The added printer is described in /etc/cups/printers.conf.

lpstat -p

List all available printers

lpstat -p C510

Display printer status information

Creating Saved Options

A full list of the options supported directly by the spooler is available from the CUPS web site.

Saved options are supported in CUPS through printer instances. These are copies of a printer that have certain options associated with them. Use the lpoptions command to create a printer instance:

lpoptions -p C510/2up -o number-up=2

User defaults and instances are created in ~/.cups/lpoptions.

Add-On Applications

See The Must-Have Freewares.

Program installers

Original sources.list

Before anything else, for the sake of security, backup the original /etc/apt/sources.list:

sudo cp /etc/apt/sources.list /etc/apt/sources.list.orig

Use Automatix!

Automatix is a free graphical package manager for the installation, uninstallation and configuration of the most commonly requested applications.

It massively simplifies the installation of a whole range of multimedia codecs, burning and ripping software, file sharing software, email clients, VoIP enabled chat clients, browsers, encryption software and a lot more!

This is a fantastic tool that all first-installations of Ubuntu should download and run!

http://www.getautomatix.com/

Simply download the .deb, install it, and it will make a few additions to your /etc/apt/sources.list file, and then it presents an extremely easy to use and intuitive GUI, much like Synaptic does!

EasyUbuntu

Alternatively, you could use EasyUbuntu, an easy to use script of the same kind that gives the Ubuntu user:

  • the most commonly requested apps (VoIP, etc.),
  • Xvid codecs,
  • MS fonts, and
  • tweaks that are not found in the base distribution.
wget http://easyubuntu.freecontrib.org/files/easyubuntu-latest.deb
wget -q http://medibuntu.sos-sts.com/repo/medibuntu-key.gpg -O- |\
    sudo apt-key add -

Extra repositories

You could as well generate your own /etc/apt/sources.list file with:

http://www.ubuntu-nl.org/source-o-matic/

Update and upgrade:

sudo aptitude update && sudo aptitude -y dist-upgrade

Click "reload" in Synaptic or run aptitude update any time you change repositories.

Recommended packages

Recommended packages

Packages that are almost always found with a specific package, but are not actually required for its use. By installing them, you can avoid having to know about "magic" packages and almost always install all related tools at one time.

Suggested packages

Packages that may make another package more usable.

By default, none of the APT tools install recommended packages, but aptitude and synaptic have built-in support to auto install recommended packages.

For aptitude, use the –with-recommends command-line option when installing or upgrading packages.

For synaptic, select Settings -> Preferences -> General, and click the check-box labeled "Consider recommended packages as dependencies".

Otherwise, you can automatically install the recommended/suggested packages by installing the wajig package.

sudo aptitude install wajig

Then, based on your choice, you can use one of the following commands provided by wajig:

installr   Install package and associated recommended packages
installrs  Install package and recommended and suggested packages
installs   Install package and associated suggested packages

So, for example, if you want to install the Apache package with all its suggested and recommended packages, issue the following command:

sudo wajig installrs apache

Alien

To install rpm packages on Ubuntu systems, use alien.

sudo aptitude install alien

Packet-writing file-system for CD

sudo aptitude install udf-tools

Google Desktop

Download http://desktop.google.com/linux/.

On your keyboard, hold down the alt key and hit F2. Enter gdlinux and click Run.