Cheap VPS & Xen Server

Residential Proxy Network - Hourly & Monthly Packages

Ubuntu 11.04 Generic – The SysAdmin Way

In this tutorial I will guide you trough the setup of Ubuntu 11.04 Generic system the way a good linux system administrator would install it. After it is complete you will have a great starting point for all of your future Ubuntu linux needs. By that I mean the following: If you are using virtual environment, you will have an image that you can clone and convert in any supported virtual format and use it as a starting point for all of your Ubuntu virtual projects. If you install this on a real hardware you can also clone you installation and use it as a starting point on various other machines with similar hardware. I will not cover cloning and conversion in this tutorial. Also as I will edit and tweak few system settings in this tutorial that I will not explain much, I hope this guide will encourage you to further explore those options and Linux in general. So let us start!

01. What you will need

If you want to test things in virtual environment I would recommend using VirtualBox, as it is free virtual manager that will work in most operating systems. If you plan to do the installation an real hardware, any desktop/notebook/workstation/server will work (even the really old ones). For this specific installation I will use Ubuntu 11.04 MinimalCD, so you will need an internet connection to download parts of installation during the setup process.


02. How long will it take

If you know your way around Linux, hour or two minimum. If you are basic user, a little longer.


03. Generic Ubuntu Installation – The installation

Download Ubuntu 11.04 MinimalCD, burn it on a CD and boot you computer/virtual machine from it.


Select Advanced options.


Select Command-line expert install.


Select Choose language.


Choose you default language. I will continue with English, but you can select whatever language you prefer (based on the country you live in).


Select your location (country you live in). I will continue with US.


Based on the location you selected in previous step, choose you locales. I will continue with en_US.UTF-8.


If you want you can select another language. If you did not go with English in the previous step you can select it now. If you think it will not be needed, just press Continue.


Configure the keyboard.


Select Yes to configure keyboard.


Press one of the offered keys.


Select No, unless you speak German or similar language that has required character.


Press required character if you speak Croatian or similar language.


Select proper value for your AltGr key (if you have one). Mine is right alt.


Select proper value for your Compose key (if you have one). I don’t have that key.


Press Enter to detect network hardware.


Deselect usb-storage. It will come again later in the installation, so you will also deselect this option.


Just press Continue. It will also come again later in the install, so you will press Continue again.


Press Enter to configure the network.


Press Yes if you wat to auto-configure you network over DHCP. If you don’t wan’t to do that, or you don’t have DHCP server/router in front of your machine, press No. I will use DHCP auto-configuration.


Select hostname for your installation. Go with generic name like u1104x64 (Ubuntu 11.04 x64) as this is a generic installation.


Leave the domain name blank.


Press Enter to select an Ubuntu archive mirror.


Select http protocol for file downloads.


Go to the top of the list and select enter information manually.


Enter as we are going to use the default Ubuntu archive mirror.


Press Continue and leave archive mirror directory as it is.


Fill in the proxy information if you use one. Leave it blank if your proxy is transparent or you don’t use one.


Press Enter to download installer components.


Just press Continue, we won’t select nothing now, as we want a clean installation.


Now you can go do something else, as this step will last a couple of minutes.


Press Enter to configure the clock.


Choose Yes to configure clock using NTP.


Enter settings for NTP server nearest to your location (as I’m in Zagreb/Croatia mine is


Press Yes if time zone selected is ok for you.


Press Enter to detect disks.


Press Enter to partition disks.


Select Manual partitioning method.


Select hard disk and press Enter to continue. Mine is marked as SCSI1 and sda, wich does not have to be your case.


Select Yes to create a new partition table.


Select msdos type as the most general one.


Select FREE SPACE line and press Enter to create first partition. I’m going to use all physical partitions, so I can use max. four of them. If you need more you will have to use logical partitions, which I’m not gonna cover in this tutorial.


Select Create a new partition and press Enter.


Our first partiton is goint to be /boot, and I don’t plan to use more than 128 MB for that one. If you think that for some reason you need more space for /boot partition, enter the value you find sutable.


Select Primary and press Enter.


Select Beginning and press Enter.


Let’s configure our /boot partition with the following options:

  • Use as: Ext4 journaling file system – as this is /boot partition we have no other option than Ext4 so we’ll use that one.
  • Mount point: /boot – This one explains it’s self.
  • Mount options: noatime – Linux records information about when files were created and last modified as well as when it was last accessed. There is a cost associated with recording the last access time. As I’m always trying to get the most performace out of my installations I will use noatime mount option (which will not record information listed before), as it may lead to significant performance improvements.
  • Label: none – I don’t use labels, which does not have to stop you from using ones.
  • Reserved blocks: 0% – Reserved block percentage reserves X percentage (default 5) of file system blocks for root/privileged user and prevents the root/privileged user owned processes from failure when file system is 100% full. As a good SysAdmin I’m always watching (monitoring) to have enough free space on my HDD-s, so I don’t use reserverd blocks. If you forget on things like that, leave this value at 5% default.
  • Typical usage: standard – Leave the default value.
  • Bootable flag: on – Set to on, as it is /boot partition.

To finish the process position yourself to Done setting up the partition and press



Select FREE SPACE line and press Enter to create second partition.


This will be our swap partition, and if we stick to some general rules when creating swap partitions, we should use the size that is equal to our RAM size, or RAM size times 1.5. Since I have a VM with 512 MB of RAM I will use 768 MB for swap space. Ofcourse todays computers all come with large RAM size, so you can use some small value like 1 GB, or skip this step and don’t use swap at all.


Select Primary and press Enter.


Select Beginning and press Enter.


Set this partition as seen on picture. Set Use as on swap area and we will not use bootable flag since we already created our /boot partition.


Select FREE SPACE line and press Enter to create third and final partition for this installation.


Leave the size as it is and just press Continue.


Select Primary and press Enter.


Select Beginning and press Enter.


Let’s configure our / (root) partition with the following options:

  • Since I have small virtual disk (8 GB), I’m using what’s left of space after creating /boot and swap partitions for root partition. Of course if you are installing this ona a real machine with a large disk, I recommend you create an 8 GB (max. 15 GB) root partition, and use rest to create fourth physical partition with mount point on /home or /media/storage, or create logical partition and add several more extended partitions on it. It’s your choice.
  • Use as: XFS journaling file system – XFS is a high-performance journaling file system created by Silicon Graphics, originally for their IRIX operating system and later ported to the Linux kernel. XFS is particularly proficient at handling large files and at offering smooth data transfers. If we consider root partition to act as a storage partition for all of our files and data, XFS file system is the best choice if we consider performance.
  • Mount point: / – This one explains it’s self.
  • Mount options: noatime – Same as /boot.
  • Label: none – I don’t use labels, which does not have to stop you from using ones.
  • Bootable flag: off – We already created our /boot partition so leave bootable flag at off.

To finish the process position yourself to Done setting up the partition and press Enter.


To finish partitioning press Finish partitioning and write changes to disk.


Press Yes to continue.



Press Enter to install the base system.


Again you can go do something else as this is going to take some time.


The advantage of installing Ubuntu from MiniCD is that you can select newest available kernel. Select linux-image-2.6.38-8-generic (current kernel at the time I’m installing this) and press Enter to continue.


Since I’m planing to use this first step installation on other machines/VM’s I will select generic driver package to be installed. If you plan to install this on a single machine/VM you can select targeted. Your choice again. But be warned, if you plan to migrate your installation or clone it on other disk that is different from the one you are installing this now, there is a big chance the thing will not work. My recommendation is to go with the generic package.


Press Enter to continue.


Press Yes to continue.


Insert password, but please respect some general rules since it’s a root password. Don’t use less than 7 characters, and use combination of small and capital letters, numbers and/or special characters.



Repeat the password from the previous step and press Continue.


I will skip creation of normal user, but if you did not allow creation of root account, continue and create normal user.


Skip the configuration of the package manager and software installation, we will do that later. Continue with the installation of the GRUB boot loader.


I’m having only one disk so I will install boot loader to master boot record. If you have multiple disks or RAID configured disks, you will have to dig the net a bit to find solution where to install boot loader.


We are almost done with the first part! Press Finish the installation.


Your choice!


There, first part done. Press Continue to reboot the machine. Remove media from your CD-Rom device or unmount it if you are using VM.


Let’s see what we have:

  • Clean installation of Ubuntu base system with basic software.
  • Latest kernel availabe for selected distribution.
  • Ready to clone image for other machines/VM’s… can be used but few additional step are required, what leads us to next chapter – Extended Generic Ubuntu Installation.

03.01 Extended Generic Ubuntu Installation

Now that we have a nice clean installation, we will do some basic system configuration and tuning. Let’s start with /etc/default and the files located in that folder.


Log in using root account, or a normal user account if you created one. Since all steps in this part of installation require elevated privileges, for normal user you will have to add sudo in front of every command. If using normal user account, you can become root by typing

sudo su

To enable root account type the following

sudo passwd root

Type in the root password. Now you can directly log in as root.


Customize /etc/default

Let’s start with /etc/default/bootlogd. Bootlogd runs in the background and copies all strings sent to the /dev/console device to a logfile. This is useful if you want to check that all services you configured to start with the system are really started. You can do this by listing the content of /var/log/boot.log file.

vi /etc/default/bootlogd

#Run bootlogd at startup ?

Next we are going to edit /etc/default/ntpdate. There are several packages related to NTP in the Ubuntu archive, probably the simplest is the client ntpdate. We will configure it to use our local time provider (mine is

vi /etc/default/ntpdate

Locate and edit the following line:

# List of NTP servers to use (Separate multiple servers with spaces.)
# Not used if NTPDATE_USE_NTP_CONF is yes.

Next we are going to reduce the number of active consoles at the startup. We will never use all the virtual consoles (TTY) that is provided with most Linux distribution. Why leave it there and let it eat memory. You can decrease startup time by removing unwanted virtual console or TTY.

vi /etc/default/console-setup

Locate and edit the following line:

# Setup these consoles. Most people do not need to change this.

Now we need to turn off those extra consoles from actually starting themselves at startup. We need to edit tty6.conf, tty5.conf, tty4.conf and tty3.conf files located at /etc/init/ folder. The procedure is the same for every file.

vi /etc/init/tty6.conf

Locate and comment the following line:

# start on runlevel [23]
# stop on runlevel [!23]

# respawn
# exec /sbin/getty -8 38400 tty6

Let’s edit our next file. We still don’t have need for IPv6, especially for our Desktops at local networks so let’s disable it at startup by editiong grub config file.

vi /etc/default/grub

Locate and edit the following line:


Now we need to confirm this change by executing the following command:


Now we will prevent system messages from being translated, by editing locale file.

vi /etc/default/locale

Add the following line at the bottom:


To confirm this change logout from your console and log back in again.

Next we will edit FSCKFIX line in rcS file. When Linux checks the file system, and finds error, fsck is called with -a option, and will only repair if no major damages are found, but if you want that fsck to try to fix the file system no matter the magnitude of the error, change FSCKFIX variable to yes.

vi /etc/default/rcS

Locate and edit the following line:


That’s it. We are done editing /etc/default files. Now let’s finish the extended step of generic installation by configuring a few more options.


Let’s put it to use

We have installed Ubuntu, and we have a nice clean image so far, yey for us! But other than looking at the blinking command prompt, there is no much use from what we have. So let’s make it useful! Let’s start with configuration of debconf, a software utility for performing system-wide configuration tasks on Unix-like operating systems.

dpkg-reconfigure debconf


Select Dialog and press Enter.


As a Sys Admin, yes I am a control freak. So select low!

In the initial setup of our installation we have skipped package management configuration. We are going to configure it now, by editing the following file:

vi /etc/apt/sources.list

If there is any content present, delete it. All of it, and insert the following lines:

deb natty main restricted universe multiverse
deb natty-updates main restricted universe multiverse
deb natty-security main restricted universe multiverse

What we have done is enable main distribution (natty) repositories and updates/security repositories. This will be enough for most of software installations there will be needed.

If you want you can delete 10-help-text file. It prints help text associated with the distro copyright after every login. I don’t like that so I delete it.

rm /etc/update-motd.d/10-help-text

Let’s update our system. Execute the following command:

apt-get update

I don’t really like apt-get, and since Ubuntu 10.10 (Maverick Merkat) there is no aptitude in default installation, so first I’m going to install that. Aptitude is basically the same thing as apt-get but it has user interface and is much more user friendly.

apt-get install aptitude

At Do you want to continue [Y/n], enter Y and press Enter.

Now start aptitude by executing:


Press Alt+T to initiate main menu and then go to Options –> Preferences, and by hitting Space key edit following options:

[X] Advance to the next item after changing the state of package
[ ] Install recommended packages automatically

Exit aptitude by hitting Q key twice.

Now we are going to upgrade our system by executing:

aptitude full-upgrade

At Do you want to continue [Y/n], enter Y and press Enter.


Select Ok and press Enter to continue.

We have a fully upgraded system so let’s do the cleanup and delete downloaded package files by executing:

aptitude clean

Now we are going to install our first software packages so let’s see which ones:

  • dma – The DragonFly Mail Agent is a small Mail Transport Agent designed for home and office use. We don’t want to install Postfix or similar just to send simple messages.
  • safecat –Safecat copies standard input to a qmail-style maildir as reliably and quickly as qmail itself. It can be used to deliver mail messages to qmail folders, or to spool data securely for later use by non-email-related applications. We will use it to process double-bounce messages.
  • emacs23-nox –My preffered text editor (nox means No X, as it will not install GUI frontend for desktop managers like Gnome and KDE). You don’t have to install emacs if you don’t like it. Choose your preffered text editior here.
  • debconf-english –This package is an alternative to the debconf-i18n package, intended for systems that are administerd only in english, and low-footprint systems.
  • debconf-i18n_ –full internationalization support for debconf. You noticed “_” at the end of the package name. It means I don’t want it so I have used the “_” character that aptitude will understand as purge order. It will remove the package and it’s installation files from our system.
  • bsd-mailx –mailx is the traditional command-line-mode mail user agent. Even if you don’t use it, it may be required by other programs.
  • sysfsutils –This package ships a configuration file /etc/sysfs.conf which allows to conveniently set sysfs attributes at system bootup. We will use it to configure some options on our disks later.
  • localepurge –Reclaim disk space by removing unneeded localization files.

To install all of these, execute the following command:

aptitude install -R -y dma safecat emacs23-nox debconf-english debconf-i18n_ bsd-mailx sysfsutils localepurge


If you intend to use generic image on other machines/VM’s, leave the System mail name as it is and press Ok to continue (as it will be configured on the machine/VM you intend to use it on).


If you intend to use generic image on other machines/VM’s, leave the Smarthost empty, as it will be configured on the machine/VM you intend to use it on.


Select Ok and press Enter to continue.

Make your choice (usually it’s not necessary), and press Ok to continue.78

Make your choice (usually it’s not necessary), and press Ok to continue.


Select Yes and press Enter to continue.


Select No and press Enter to continue.


Select Yes and press Enter to continue.


Select No and press Enter to continue.


Select Yes and press Enter to continue.

When the installation is over, let’s do the cleanup and delete downloaded package files by executing:

aptitude clean

Let’s also defragmet our root partition by executing:

xfs_fsr -v /dev/sda3

Reboot the system by executing:



04. The conclusion

As I stated at the beginning of this tutorial, what you have now is a great starting point for all of your future Ubuntu projects.

If you use it for virtualization:

  • Multiple clone option
  • Conversion and migration to all supported VM systems

If you use it for real machines:

  • Simple creation of full HDD image by using dd
  • Also simpe deployment to other HDD-s/machines using dd
  • Cloning/deployment by using any other commercial or free cloning tool

Don’t forget at least to change host name and network settings when cloning this installation to other machines/VM-s to avoid possible conflicts, and enjoy Ubuntu. That’s all folks!