Installing An Ubuntu Desktop
Future version | |
Currently supported | |
8 months left | |
4 months left | |
Not supported |
12.04 Precise | April 2017 |
12.10 Quantal | April 2014 |
13.04 Raring | January 2014 |
13.10 Saucy | June 2014 |
14.04 Trusty | April 2019 |
Ubuntu is a Debian-based Linux distribution from Canonical that is renowned for its accessibility to newcomers. Starting with version 10.04, it has also made great strides in presenting a pleasing aesthetic.
This page will only provide information for the desktop editions of Ubuntu that are still supported. Refer to the chart on the right.
Pre-Installation
Please read Drive Partitioning first. It contains useful information and points to consider when installing OSes on your computer.
If you want to use a swap file instead of a swap partition, you can do so even while using the Live version of the installer.
You may want to give the "mini.iso" version of the installer a spin. Think "alternate" except all packages are downloaded.
CODE_NAME=[lucid|maverick|natty|oneric|precise] && ARCH=[i386|amd64] URL_PREFIX=http://archive.ubuntu.com/ubuntu/dists URL_SUFFIX=main/installer-$ARCH/current/images/netboot/mini.iso wget $URL_PREFIX/$CODE_NAME/$URL_SUFFIX
Post-Installation Configuration
APT
The following are steps to customize apt-get.
sources.list
Canonical sets up the /etc/apt/sources.list file a bit schizophrenicly, It's designed to make it easier for newcomers to tell what they're getting into, but it ends up making it hard to navigate when things go wrong.
VN=`lsb_release -rs | cut -d. -f1``lsb_release -rs | cut -d. -f2` CN=`lsb_release -cs` AR="main restricted universe multiverse" [ $VN -gt 1010 ] && VB=contrib || VB=non-free echo '# If you'd like sources, duplicate these lines and change deb to deb-src deb http://us.archive.ubuntu.com/ubuntu/ '$CN' '$AR' deb http://us.archive.ubuntu.com/ubuntu/ '$CN'-updates '$AR' deb http://us.archive.ubuntu.com/ubuntu/ '$CN'-backports '$AR' deb http://security.ubuntu.com/ubuntu '$CN'-security '$AR' deb http://archive.canonical.com/ '$CN' partner # Some additional repositories: deb http://deb.opera.com/opera/ stable non-free #Opera deb http://packages.medibuntu.org/ '$CN' free non-free #Medibuntu deb http://download.virtualbox.org/virtualbox/debian '$CN' '$VB' #Virutalbox' > \ /etc/apt/sources.list
Launchpad PPAs
AAR="add-apt-repository" VN=`lsb_release -rs | cut -d. -f1``lsb_release -rs | cut -d. -f2` [ $VN -gt 804 -a $VN -lt 1204 ] && $AAR ppa:ubuntu-x-swat/x-updates #Xorg Updt [ $VN -gt 910 -a $VN -lt 1104 ] && $AAR ppa:mozillateam/firefox-stable #Firefox [ $VN -gt 910 -a $VN -lt 1110 ] && $AAR ppa:ripps818/coreavc #MPlayer2 [ $VN -gt 910 -a $VN -lt 1110 ] && $AAR ppa:am-monkeyd/nautilus-elementary-ppa #Naut Elem [ $VN -gt 910 -a $VN -lt 1204 ] && $AAR ppa:nilarimogard/webupd8 #UMP & DBX
sources.list.d
With the advent of the add-apt-repository command comes /etc/apt/sources.d with a bunch of .list files. What happens is that the command grabs the PPA key and adds an entry to /etc/apt/sources.d in one shot. The command apt-get will read /etc/apt/sources.list and all the files in /etc/apt/sources.d. This can lead to confusion if you are used to /etc/apt/sources.list being the sole location of repositories.
If you wish to get everything back into the /etc/sources.list file, you can execute the following commands:
find /etc/sources.list.d -name "*.list" -exec cat {} >> /etc/sources.list rm /etc/sources.list.d/*.save rm /etc/sources.list.d/*.list
Keys
wget -qO- http://deb.opera.com/archive.key | apt-key add - wget -qO- http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc | apt-key add - wget http://packages.medibuntu.org/pool/free/m/medibuntu-keyring/medibuntu-keyring_2008.04.20_all.deb dpkg -i medibuntu-keyring_2008.04.20_all.deb
Service Configuaration
These services are self-explanatory and most users don't need them:
update-rc.d bluetooth disable update-rc.d pcmciautils disable
If you want more control over services, apt-get install rcconf and look in /etc/init.
CPUFreq
Intel Pentium M | |
1.6GHz | |
⇧95.00% | ⇩83.13% |
1.4GHz | |
⇧95.00% | ⇩81.43% |
1.2GHz | |
⇧95.00% | ⇩79.17% |
1.0MHz | |
⇧95.00% | ⇩76.00% |
800MHz | |
⇧95.00% | ⇩71.25% |
600MHz |
Intel Atom | |
1.60GHz | |
⇧95.00% | ⇩78.97% |
1.33GHz | |
⇧95.00% | ⇩76.43% |
1.07GHz | |
⇧95.00% | ⇩71.03% |
800MHz |
AMD Athlon X2 64 | |
2.0GHz | |
⇧95.00% | ⇩76.00% |
1.6GHz | |
⇧95.00% | ⇩47.50% |
800MHz |
VIA C7 1.2GHz | |
1.2GHz | |
⇧95.00% | ⇩31.67% |
400MHz |
By default, cpufreq_ondemand sets the up_threshold to 95%. What this means is that CPU usage must reach 95% at the current frequency before cpufreq_ondemand will bump up processor speed to the next frequency. It also means that the processor will be scaled back down if CPU usage dips below [old-frequency] ÷ [new-frequency] × [threshold].
- Such a high number is irrelevant on processors with big gaps between frequencies. The VIA C7 will often scale as intended anyway because the lowest frequency step is a mere third of the max frequency.
- The lower the lowest frequency is, the bigger the chance that the processor will bump up to the next step. This plays well with the VIA C7 and Pentium M's, and even the Athlons.
- With smaller jumps between frequencies, the processor usually gets stuck at a mid-line frequency when the processes running could benefit from a speed bump.
The last point completely screws things up. I've seen the Athlon X2 chug on 720p video because of the 95% threshold. The code would start dropping blocks because it couldn't keep up, which kept the processor from reaching the threshold for full-throttle. When it did reach full-throttle, it wouldn't be long before the video encoding would "calm down," thus CPU usage would fall, thus the frequency would be stepped down again. I've also seen the Asus EeePC (which used an under-clocked and under-volted Celeron) chug along at 667MHz because that was "good enough" according to the threshold.
First, Ubuntu still ships with an ondemand init.d script. Make sure it is disabled.
update-rc.d ondemand disable
The best way to maintain the cpu_freq up_threshold is to use the sysfs-utils package to manage entries in /etc/sysfs.conf.
apt-get install sysfs-utils echo '/sys/devices/system/cpu/cpufreq/on_demand/up_threshold=50' >> /etc/sysfs.conf echo '/sys/devices/system/cpu/cpufreq/on_demand/sampling_down_factor=10' >> /etc/sysfs.conf
Recommended settings:
- 40% for desktops as 60% still hampers tasks a bit.
- 60% for laptops where the hampering might be welcome in exchange for battery life.
- 80% for laptops where battery life is king or nothing CPU-intensive will take place.
If you wish to get some useful information about what CPUFreq is doing:
apt-get install cpufrequtils
XDG Base Directories
Programs that are XDG-aware will treat certain folders in your /home directory differently from others. These are the Desktop, Documents, Downloads, Music, Pictures, Public, Templates, and Videos folders. Proper-case names are a drag to type.
This script will go through these special folder names and either move them or (when the move fails) create them.
for $LSU in /home/*; do for $DNP in Desktop Downloads Templates Public Documents Music Pictures Videos; do DNL=`echo "$D" | tr '[A-Z]' '[a-z]'` mv $LSU/$DNP $LSU/$DNL || mkdir -p $LSU/$DNL done echo 'XDG_DESKTOP_DIR="$HOME/desktop" XDG_DOWNLOAD_DIR="$HOME/downloads" XDG_TEMPLATES_DIR="$HOME/templates" XDG_PUBLICSHARE_DIR="$HOME/public" XDG_DOCUMENTS_DIR="$HOME/documents" XDG_MUSIC_DIR="$HOME/music" XDG_PICTURES_DIR="$HOME/pictures" XDG_VIDEOS_DIR="$HOME/videos"' > $LSU/.config/user-dirs.dirs done
Make sure these directories exist, or else non-existing directories will be set to $HOME the next time xdg-update-user-dirs is run. (By default, it is run upon login to Gnome.)
GRUB2
I really don't care for Canonical's default methodology for putting listings on the GRUB menu.
- Version of Ubuntu is not listed. (Just Ubuntu instead of Ubuntu 9.10 or Ubuntu 10.4 LTS.)
- This can be fixed by editing the following line in /etc/default/grub
sed -i 's/lsb_release -i -s/lsb_release -ds/g' /etc/default/grub
- Recovery option for each Ubuntu kernel found doubles the listings.
- This can be fixed by uncommenting the following line in /etc/default/grub
sed -i 's/^#GRUB_DISABLE_LINUX_RECOVERY/GRUB_DISABLE_LINUX_RECOVERY/g' /etc/default/grub
- Memtest 86+ serial console superfluous for most home users.
- You can disable the Memtest entries entirely by using chmod a-x /etc/grub.d/20_memtest86+
- You must edit the script if you wish to disable the serial console entry for Memtest86+ only.
- No version detection for Windows Vista and Windows 7, defaulting to Windows [Vista | 7] (loader) (on /dev/sdx).
- Recovery partitions that use Vista or 7 Pre-installation Environments will also show up as Windows [Vista | 7] (loader) (on /dev/sdx).
- The /etc/grub.d/30_os-prober script must be directly edited to customize entries.
- Any changes made made to the files 00_default, 10_linux, 20_memtest86+, and 30_os-prober may be over-written by an update.
You can try to argue with the scripts over the particulars of names. Or you can use 40_custom and be done with it.
The intent with the following script is to keep the current grub.cfg generation in place but move everything that the linux, memtest86+, and os-prober scripts would normally generate into the custom script. It accomplishes this by first disabling the header and theme scripts and then temporarily generating an invalid grub.cfg file for cating into the custom script. The header and theme scripts will be then be re-enabled and the linux, memtest86+, and os-prober scripts will then be disabled. After making some changes to the custom script and the kernel-img.conf file, a new initrd and grub.cfg will be generated.
mv /etc/grub/grub.cfg /etc/grub/grub.bak chmod a-x /etc/grub.d/{00,05}* && update-grub cat /boot/grub/grub.cfg >> /etc/grub.d/40_custom chmod a+x /etc/grub.d/{00,05}* && chmod a-x /etc/grub.d/{1,2,3}0* sed -i 's/\/boot\/initrd\.img.*/\/initrd\.img/g' /etc/grub.d/40_custom sed -i 's/\boot\/vmlinuz.*/\/vmlinuz/g' /etc/grub.d/40_custom sed -i 's/link_in_boot = no/link_in_boot = yes/g' /etc/kernel-img.conf update-initramfs -u && update-grub
Edit the entries in /etc/grub.d/40_custom to suit your taste.
MTU
If you are using Gigabit Ethernet, you can change the MTU setting for better performance. Gigabit Ethernet accepts MTUs up to 9000, but a lot of Gigabit Ethernet chipsets do not go this high. This number cannot be any higher than any server you plan to communicate with.
Use the following command to determine which Ethernet device you are using. The one with an IP address is the one you are interested in.
ip addr
You'll get output like this:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether hh:hh:hh:hh:hh:hh brd ff:ff:ff:ff:ff:ff inet nnn.nnn.nnn.nnn/24 brd 192.168.1.255 scope global eth0 inet6 hhhh::hhhh:hhhh:hhhh:hhhh/64 scope link valid_lft forever preferred_lft forever 3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000 link/ether hh:hh:hh:hh:hh:hh brd ff:ff:ff:ff:ff:ff
Use the following command to determine the the max MTU setting.
sudo ip link set [device] mtu [1500-9000]
You'll basically be playing a game of guess-the-number. No feedback means the command was successful. You'll know you've gone too far when you see [DRIVER] answers: Invalid argument.
Once you've determined the largest valid number you can use, you need to to make sure that your network hub or router isn't a limiting factor and that the drivers aren't allowing you to set the MTU higher than the actual hardware can handle.
ping -s [size-minus-8] [ip-address]
If you do not receive a response with the MTU setting you got earlier (less 8 bytes for the ICMP header) then something is goofed and you will have to play the number guessing game again until you can make a successful ping.
Once you find your optimal MTU setting, it's time to get the setting to stick on every boot.
While the /etc/rc.local way is almost always guaranteed work in Debian, Debian won't absolutely guarantee the network is up before init reaches rc.local, so it's best to use /etc/network/interfaces instead.
If you're using DHCP:
auto eth0 iface eth0 inet dhcp post-up /sbin/ip link set eth0 mtu [nnnn]
If you're using static addressing:
auto eth0 iface eth0 inet static address 192.168.1.nnn network 192.168.1.0 netmask 255.255.255.0 gateway 192.168.1.1 broadcast 192.168.1.255 mtu nnnn
Plymouth
Ubuntu's boot splash screen Plymouth runs just fine most of the time, automatically detecting the highest resolution your monitor supports and using that. However, if you install the proprietary NVIDIA or ATI drivers, the screen will default down to 640x480.
Install the v86d package needed to use uvesafb
apt-get -y install v86d $RES=800x600 && $COLORDEPTH=24 $UVS=mode_option=$DRS-$COLORDEPTH,mtrr=3,scroll=ywrap # EDIT GRUB2 CONFIG sed -i 's/quiet splash/quiet splash nomodeset video=uvesafb\:'$UVS'/g' /etc/default/grub sed -i 's/#GRUB_GFXMODE=.*/GRUB_GFXMODE='$RES'/g' /etc/default/grub echo "uvesafb $UVS" >> /etc/initramfs-tools/modules # EDIT INITRAMFS MODULES echo 'FRAMEBUFFER=y' > /etc/initramfs-tools/conf.d/splash # CONFIGURE SPLASH SCREEN sudo update-initramfs -u && sudo update-grub2 # UPDATE EVERYTHING
Remove Update Notifier
Since Ubuntu 9.04, Update Notifier has replaced the standard tray icon generated by Update Manager. There are problems with it's methodology, though.
- Update Notifier is an attempt to mitigate the frequency in which the user sees updates, as some see the frequency of Linux updates as a sign that the software is buggier than commercial software.
- It will only notify the user of non-security updates after the oldest update is about a week old.
- It will notify the user of security updates immediately, but only via a single message pop-up that the user might miss if they are not at the computer when it happens.
To get the old Update Manger icon in the system tray, you have to disable Update Notifier.
gconftool -s --type bool /apps/update-notifier/auto_launch false
Post-Installation Packages
Configuration
Compiz Advanced Settings
sudo apt-get install compizconfig-settings-manager compiz-plugins-extra
Graphics
sudo apt-get install gimp inkscape
Emulation
WINE
sudo apt-get install wine
If you manage to completely screw something up:
sudo apt-get purge ^wine* rm -r ~/.wine rm -r ~/.config/menus/applications-merged/wine* rm -r ~/.local/share/applications/wine rm -r ~/.local/share/desktop-directories/wine* rm -r ~/.local/share/icons/????_*.xpm
Qemu
sudo apt-get install qemu-kvm kvm-pxe sudo addgroup `whoami` kvm
VirtualBox
sudo apt-get install virtualbox-3.2
Multimedia
sudo apt-get install avidemux vlc
Networking
NFS
To insall:
sudo apt-get install nfs-common
To mount an NFS share at boot, add a line to /etc/fstab
[address]:[share] [mount-point] nfs rw 0 0
Replacing Evolution With Thunderbird
Thunderbird is the default mail client starting with Ubuntu 11.10
I hate Evolution as it's way too much for a home user. It tries to mimic Outlook (not Express, the office-oriented one), which has Calendars and ToDo lists, and also offers Palm integration and support for Exchange and GroupWise. You can get support for Calendars in Thunderbird. That leaves Pidgin integration as a sole feature of interest to home users, which is not enough in my opinion.
Unfortunately, Evolution functionality is broken up into many libraries that other Gnome applications also rely on. If you want to get rid of Evolution only:
- Failsafe method
Open Synaptic Package Manager. search for evolution in Name and Description, and then sort by whether or not a package is installed to bring all installed packages to the top. One by one, right-click each installed package and click Mark for Complete Removal. A dialog box will come up showing you what else will be removed if you choose remove this package. As long as the things you want are not going to be removed (like gnome panel, applets, or other applications) click Mark. Otherwise, click Cancel and move to the next installed package. Once you are done, click Apply.
- Ubuntu 10.04:
- contact-lookup-applet replaced by evolution-indicator (switch to a unified message center)
- couchdb introduced
- Some functionality broken out into libraries (libbackend, libdata-cal, libexchange-storage)
- New libraries are introduced (libegroupwise, libgdata, libgdata-google).
sudo apt-get purge evolution evolution-common evolution-couchdb \ evolution-data-server evolution-exchange evolution-indicator \ evolution-plugins evolution-webcal ^libebackend* ^libedata-book* \ ^libedata-cal* ^libegroupwise* ^libexchange-storage* ^libgdata-google* \ ^libgdata* nautilus-sendto
This will free a whopping 79.1MB
- Ubuntu 11.04
- The package evolution-couchdb is not installed by default.
- More functionality broken out into libraries (libevolution)
- Totem started relying on libgdata libraries, so you can't remove them without removing totem.
sudo apt-get purge evolution evolution-common evolution-data-server \ evolution-exchange evolution-indicator evolution-plugins evolution-webcal \ ^libebackend* ^libedata-book* ^libedata-cal* ^libegroupwise* libevolution \ nautilus-sendto
Now to install Thunderbird:
sudo apt-get install thunderbird
To regain the new notification features of Ubuntu 10.04:
sudo apt-get install bzr libnotify-bin cd ~ bzr branch lp:libnotify-mozilla cd ~/libnotify-mozilla ./build.sh
Start Thunderbird, go to Tools → Add-ons, click the [Install…] button, then browse to the libnotify-mozilla directory, and finally Open libnotify-mozilla.xpi.
Taken For Granted On Windows
Adobe Flash Player
Make sure you have Canonical's Partner repository enabled as it is the only place to find both the 32-bit and 64-bit version of the Flash plugin.
apt-get install -y adobe-flashplugin
Buttons On The Right
Ubuntu 10.04 LTS has moved the buttons to left ala Mac OS. While it should be noted that Canonical plans to provide something in the new empty space, nothing is there now. Execute this line in a terminal to move them back.
gconftool-2 --set /apps/metacity/general/button_layout --type string menu:minimize,maximize,close
Fonts
Most of the Windows fonts can be had from the repository
sudo apt-get install msttcorefonts
However, Tahoma and the newer SegoeUI is not included. If you have an existing Windows installation, you can copy them from there.
You can simply double-click a TTF file to get the Font Preview and use the Install button, but that will only install the font for yourself.
To install fonts for all users, copy the TTF file to /usr/share/fonts/truetype. Then run these commands.
sudo fc-cache -fv fc-cache -fv
KeePass
Download the portable version of KeePass at http://keepass.info/download.html and extract it anywhere it your /home directory.
Surprisingly, a default install of Ubuntu 10.04 already has most of what you need from Mono to get KeePass 2.x running. All you need is one additional package.
sudo apt-get install libmono-winforms2.0-cil
Win7-Style Task Bar
Once you get past "OMG Mac OS X" the Windows 7 task bar is actually a welcome feature. Most programs have good-looking readily-identifiable icons, so why not just use the icon and save some space? And now that icons represent running tasks, why not allow people to pin icons to the task bar and replace the Quick Launch bar? Multiple icons for the same program might be confusing now that we eliminated the text, so why not provide a preview feature when people hover their mouse over an icon so they can not only see all running windows, but select the particular window they want?
Talika duplicates this functionality.
sudo apt-get install dockbarx
Other Stuff
sudo apt-get install lm-sensors sun-java6-jre sun-java6-plugin