My Ubuntu Installation

Last updated $Date: 2008-10-28 13:44:31 $

Martti Kuparinen <martti.kuparinen@iki.fi>

http://www.iki.fi/kuparine/comp/ubuntu/en/install.html

Abstract

This is how I installed and configured my PC running Ubuntu 8.04.


[ Please note that this page is also available in Finnish ]

[ See also My Ubuntu Server Installation with VMware Server, My Ubuntu UML Installation, Hard Drive Encryption in My Ubuntu Installation and Encrypted directories with EncFS in My Ubuntu Installation ]


Table of Contents

1. Introduction
2. Initial install
3. Adding more software repositories
4. Installing applications
5. Installing and configuring SSH server
6. Configuring X
7. Installing VMware Workstation
8. Installing VMware Server
9. Installing VMware Player
10. Configuring firewall
11. Useful links

1. Introduction

This document and the installation helper script have been tested on Ubuntu 8.04. The script works with the following Ubuntu releases: 8.04 and 8.10.

2. Initial install

Start by fetching the installation CD image from the Ubuntu download page. Personally I want to use the text-based installation so I used the "Alternate install CD" image. Make sure the MD5 checksum matches with the published value before burning the ISO file or the installation may fail. Reboot with the new installation CD and follow the instructions to install Ubuntu.

Before installing think few minutes how to divide the hard disk into multiple filesystems. In my opinion it's important to have a separate filesystem for /home so it's even possible to reinstall the whole system without moving your personal data to some temporary location before reinstall. I have two identical 250 GB SATA disks. See this page how I configured RAID1 to have some protection agaist disk failures.

Most the following steps can be performed automatically by saving this install.sh script on your home directory and running it inside a terminal (Applications > Accessories > Terminal). It is safe to run the script multiple times if you need to abort it at some point.


wget http://www.iki.fi/kuparine/comp/ubuntu/en/install.sh
sh install.sh

Currently the install.sh script does not install and/or configure the following applications so these must be done manually by following this document:

3. Adding more software repositories

Login to the newly installed Ubuntu system and select Applications > Accessories > Terminal. Modify /etc/apt/sources.list and update your newly installed system. With these settings you have more applications available for download and install. Replace fi with your country code (fi = Finland, se = Sweden, ...) in the following example to access the closest national mirror.


sudo gedit /etc/apt/sources.list

## MAIN AND RESTRICTED REPOSITORIES
deb http://fi.archive.ubuntu.com/ubuntu/ hardy main restricted
deb http://fi.archive.ubuntu.com/ubuntu/ hardy-security main restricted
deb http://fi.archive.ubuntu.com/ubuntu/ hardy-updates main restricted
deb-src http://fi.archive.ubuntu.com/ubuntu/ hardy main restricted
deb-src http://fi.archive.ubuntu.com/ubuntu/ hardy-security main restricted
deb-src http://fi.archive.ubuntu.com/ubuntu/ hardy-updates main restricted

## UNIVERSE REPOSITORY
deb http://fi.archive.ubuntu.com/ubuntu/ hardy universe
deb http://fi.archive.ubuntu.com/ubuntu/ hardy-security universe
deb-src http://fi.archive.ubuntu.com/ubuntu/ hardy universe
deb-src http://fi.archive.ubuntu.com/ubuntu/ hardy-security universe

## MULTIVERSE REPOSITORY
deb http://fi.archive.ubuntu.com/ubuntu/ hardy multiverse
deb http://fi.archive.ubuntu.com/ubuntu/ hardy-security multiverse
deb-src http://fi.archive.ubuntu.com/ubuntu/ hardy multiverse
deb-src http://fi.archive.ubuntu.com/ubuntu/ hardy-security multiverse

## CANONICAL REPOSITORY
deb http://archive.canonical.com/ubuntu/ hardy partner

## MEDIBUNTU REPOSITORY
deb http://packages.medibuntu.org/ hardy free non-free
deb-src http://packages.medibuntu.org/ hardy free non-free

sudo aptitude update && sudo aptitude dist-upgrade

4. Installing applications

Next install the following programs. The following commands should be executed on a terminal window (Applications > Accessories > Terminal).

## Some public keys
cd /tmp
wget http://packages.medibuntu.org/medibuntu-key.gpg
sudo apt-key add medibuntu-key.gpg

## Language support (fi = Finnish, se = Swedish, ...)
sudo aptitude install language-pack-fi language-support-fi
sudo aptitude install language-pack-gnome-fi

## RealPlayer
sudo dpkg -P realplay
sudo aptitude install helix-player mozilla-helix-player

## Acroread
sudo aptitude install acroread
sudo aptitude install mozilla-acroread
sudo aptitude install acroread-plugins

## Multimedia Codecs
sudo aptitude install ubuntu-restricted-extras
sudo aptitude install gstreamer0.10-pitfdll
sudo aptitude install w32codecs # 32-bit
sudo aptitude install w64codecs # 64-bit
rm -rf ~/.gstreamer-0.10
gst-inspect-0.10

## DVD playback
sudo aptitude install libdvdcss2
sudo aptitude install libdvdnav4
sudo aptitude install gxine
sudo aptitude install libxine-main1
sudo aptitude install libxine-extracodecs
sudo aptitude install libxine-ffmpeg
sudo aptitude install vlc
sudo aptitude install mplayer

## CD/DVD burning
sudo aptitude install k3b-i18n

## Java plugin
sudo aptitude remove icedtea-gcjwebplugin
sudo aptitude install sun-java6-jre sun-java6-plugin

## Thunderbird
sudo aptitude install mozilla-thunderbird
sudo aptitude install mozilla-thunderbird-enigmail

## Compilers and manual pages
sudo aptitude install build-essential manpages-dev

## NFS, NIS and NTP
sudo aptitude install nfs-common
sudo aptitude install nis
sudo aptitude install ntp

## Rootkit detection
sudo aptitude install chkrootkit rkhunter
chkrootkit
rkhunter --checkall

5. Installing and configuring SSH server

Next install and configure SSH server to allow only your normal users to login. If your system has usernames jane and john make sure /etc/ssh/sshd_config has these lines. Launch Applications > Accessories > Terminal. Modify the settings and restart the SSH server.


sudo aptitude install openssh-server
sudo gedit /etc/ssh/sshd_config

Protocol 2
...
PermitRootLogin no
...
AllowUsers jane
AllowUsers john

sudo /etc/init.d/ssh restart

Sometimes you may need to limit which hosts can contact the SSH server. Restrictions can be implemented by using the /etc/hosts.allow and /etc/hosts.deny files. The next allows connections only from trusted networks.


sudo gedit /etc/hosts.allow

# Allow SSH from my own networks
sshd : localhost
sshd : 10.0.0. 192.168.
sshd : .mydomain.com .mydomain.net

sudo gedit /etc/hosts.deny

# Deny everything by default
ALL : ALL : severity auth.info

6. Configuring X

If you have an NVIDIA graphics card (I have GeForce FX 5200) it might be a good idea to install the accelerated driver for X. Otherwise the screen might be the bottleneck when using graphics intensive applications like DVD players and games.


sudo aptitude install nvidia-glx-new
sudo gedit /etc/X11/xorg.conf

Section "Device"
        Identifier      "Configured Video Device"
        Driver          "nvidia"
EndSection

Older NVIDIA graphics cards require the nvidia-glx-legacy package. The easiest way to find out which is required: install first nvidia-glx-new and if the graphical login screen does not appear then remove nvidia-glx-new and install nvidia-glx-legacy.

In some cases you may have to fetch the driver source code from the NVIDIA's web pages and compile the required driver yourself.


wget http://us.download.nvidia.com/XFree86/Linux-x86/173.14.12/NVIDIA-Linux-x86-173.14.12-pkg1.run
sudo sh NVIDIA-Linux-x86-173.14.12-pkg1.run

For ATI cards, type the following commands:


sudo aptitude install xorg-driver-fglrx
sudo dpkg-reconfigure xserver-xorg
## Select the "fglrx" driver instead of "ati"

sudo gedit /etc/X11/xorg.conf

## Make sure you have the following settings
Section "Device"
	Identifier	"ATI Graphics Adapter"
	Driver		fglrx"
	Option		"VideoOverlay" "on"
	BusID		"PCI:1:0:0"
EndSection

After reboot you can test that the accelerated driver is really used with the following command:


glxinfo | grep -i direct
direct rendering: Yes

At work I also have NVIDIA GeForce FX 5200 (with one DVI and one VGA connector) and two 20" Dell 2007FP TFTs. As I write code during day time it's nice to have two monitors side by side forming a big desktop, one for writing code and compiling the code, and the other for debugging with DDD and network monitoring with wireshark. I got TwinView working with this xorg.conf file.

7. Installing VMware Workstation

VMware Workstation is a commercial virtualization software which enables you to run Windows on your Linux PC.


sudo aptitude install build-essential linux-headers-generic

tar xzf VMware-workstation-6.0.5-109488.i386.tar.gz -C /tmp
cd /tmp/vmware-distrib
sudo ./vmware-install.pl

8. Installing VMware Server

VMware Server is a free software which enables you to run Windows on your Linux PC. See a separate document how I installed VMware Server. Please note that unlike with VMware Player, you can create virtual machines with VMware Server.

9. Installing VMware Player

VMware Player is a free software which enables you to run Windows on your Linux PC. This needs an existing virtual machine which can be created with the non-free VMware Workstation, with the free QEMU and with the free VM Builder.

Note: VMware Workstation installs also the VMware Player so these steps are only needed if you don't have a VMware Workstation installed.

VMware Player 2.x is not yet available for Ubuntu as a .deb package so you need to install it manually. Start by fetching the required .tar.gz file from the VMware Player download page.


tar xzf VMware-player-2.0.5-109488.i386.tar.gz -C /tmp
cd /tmp/vmware-player-distrib
sudo ./vmware-install.pl

10. Configuring firewall

Even though Ubuntu does not listen to any non-localhost ports by default I want to limit how my PC is visible to others. This is done by using the standard iptables firewall which is included in the Ubuntu installation. You could of course install Firestarter or GuardDog from the Synaptic package manager but I prefer a simple textfile-based solution.

Download this firewall script to your Desktop and modify it according to your network settings.


gedit ~/Desktop/firewall

sudo cp ~/Desktop/firewall /etc/init.d/firewall
sudo chmod 755 /etc/init.d/firewall
sudo ln -sf ../init.d/firewall /etc/rcS.d/S42firewall
sudo /etc/rcS.d/S42firewall restart

11. Useful links