Installfest: A Post-Install Procedure for Ubuntu Linux

The second issue issue was that the Ubuntu install was close to—but not quite— what I thought we should deliver. Ubuntu doesn't provide a lot of choice. You can pick a desktop install (the default) or a server install, but you don't have any finer grain control than that. The install procedure has no provisions to add or remove packages, tailor the desktop, or load updates. If we wanted to do any of these things (and we did), then we'd need to develop our own post-install procedure.

I planned the post-install procedure by starting with a stock Ubuntu desktop installation and then noting all of the things that I wanted to change. Here they are:

  • Office Applications – The OpenOffice application suite is loaded by default. Unfortunately, it's a big bloated package that runs poorly on low-end systems. There are lighter-weight office applications available, but the default Ubuntu install does not load them. So, we'd have to add them afterwards. The Abiword text processor and Gnumeric spreadsheet were selected.
  • Mail Client – The default email client on the Ubuntu desktop is Evolution. It's more than a mail program, it's a personal information manager that patterns itself upon Microsoft Outlook. (Not Outlook Express, but Outlook—a tool used widely in corporate environments and hated most everywhere else.) I thought that Mozilla Thunderbird, made by the same swell folks who brought us the Firefox web browser, would be a better choice. That's not part of the default Ubuntu load either, so we'd need to add that.
  • Mail Client Integration – There is a button on the desktop (called an "application launcher") that starts the email program. By default, it starts Evolution. If we were going to make Mozilla Thunderbird the preferred mailer we'd need to fix that. Also, we'd need to reassign mailto: handling to Thunderbird.
  • 386 Kernel – Ubuntu installs a Linux kernel for the 80386 processor, not the one optimized for a Pentium (or better) processor. That's odd. First, the installer ought to be able to detect the hardware and install the right kernel. After all, it loads the hardware-optimized glibc runtime library. Second, there is no bloody way that the Ubuntu desktop is going to run reasonably on a pre-Pentium system. This is, flat out, a deficiency in the Ubuntu install procedure. Our post-install should load the right kernel, to remedy that.
  • Package Updates – The current Ubuntu release was issued a couple of months ago. There have been several security and bugfix updates since then. I thought we should install those updates too.
  • Enable Network Repositories – If you install Ubuntu on a host that is not connected to a network, then the network repositories in /etc/apt/sources.list are not enabled. This would be a problem if a user brought the system home and put it on the Internet: they wouldn't be able to get updates without reconfiguration. My research found no ill effect from enabling network repositories on an unconnected system, so I thought we should do that.

The first step is to assemble the bundle of packages for the post-install. I don't want to post a list, because it will be out of date in two weeks. Plus, you may want to tailor the selection. So, instead, I'll describe the procedure I used to collect the packages, which I later burned to a CD for post-install. Here it is:

  • First, do a stock Ubuntu install on a clean machine.
  • Go into /etc/apt/sources.list and enable the Universe repository.
  • To clean out packages previously installed, run: aptitude clean
  • To download the current packages list, run: aptitude update
  • To install the additional applications plus the Pentium kernel, run: aptitude install abiword gnumeric mozilla-thunderbird linux-686
  • To apply all of the security and bugfix updates, run: aptitude dist-upgrade
  • All of the packages just loaded are cached in the /var/cache/apt/archives directory. Go grab them.
  • There was a linux-386 kernel update in the pile. I removed it since I wanted to upgrade to the linux-686 Pentium kernel.

Once you have all of these packages you can burn them to a CD. At post-install time you can mount the CD and load all the package updates in one fell swoop by running the dpkg command. (Fortunately, there weren't any ordering or dependency issues, so nothing more complicated was needed.)

The post-install was going to require some tweaks to the default Gnome desktop. Gnome uses a sort of registry for its configuration system. You can use the gconf-editor program to browse the registry...err...I mean configuration system. You can use gconftool-2 to manipulate the configuration system from the command line. We'd use that in post-install to tailor the desktop.

The final post-install item was to update the /etc/apt/sources.list to enable network repositories. I just grabbed the sources.list from an installation I did on a network-connected system.

Once I had all of this information I bundled it up into a CD. The CD contained the following items:

  • A debs subdirectory that contains all of the update/upgrade packages to install.
  • A copy of the network-enabled sources.list file.
  • A script to perform the post-install procedure.

Below is a simplified version of the post-install procedure script. To use this script you would need to mount the CD and then move into the mount point directory. (Sorry about the long lines; for improved readability click the "printable format" link at the very bottom of the page.)

#!/bin/sh
dpkg -i --refuse-downgrade --skip-same-version -R ./debs
install -c -m 644 ./sources.list /etc/apt/sources.list
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set "/desktop/gnome/url-handlers/mailto/command" "mozilla-thunderbird %s"
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set "/apps/panel/default_setup/objects/email_launcher/launcher_location" "/usr/share/applications/mozilla-thunderbird.desktop"

This procedure resulted in an extraordinarily easy post-install. It produced a nice (and up-to-date) system for the user. It took less than ten minutes to run. Most of that was package updates. The debs subdirectory contained 48 packages totalling 72MB in size.

I recommend this post-install methodology for anybody who wants to deliver Ubuntu Linux systems.

I thought today's entry would wrap up the installfast saga...but guess what? Yes, there is more. I'll be back tomorrow to present our documentation (including a nifty "Quick Start Guide") and a discussion of the support issues.