There is an endless joke about each new year being the Year of Linux on the Desktop, which never quite comes. I did actually use Linux as my Desktop environment for several years -- in between using OS/2 in the late 1990s and then Mac OS X since about 2009.

These days I still use Linux a lot on servers, but have only one active "desktop" system using Linux -- an old HP NC6220 laptop that I mostly use for travelling to overseas conferences. That laptop is a little over 10 years old now, so fairly long in the tooth, but it mostly still works. Even if the 1.5GB of RAM and 160GB hard drive look fairly anemic by modern standards (and both the RAM and hard drive were upgraded from the originally purchased system).

That laptop had Ubuntu Linux 10.04 LTS installed on for the last few years, which is now well past its End of Life date (especially for the Desktop software -- but fortunately it had relatively little of the "Dekstop" softare installed so was not that insecure in its occassional use).

Since I am not a fan of the Ubuntu Desktop changes in recent years -- Unity and advertising on the Desktop -- and have used Debian for years, I have decided to go back to Debian as the Linux distribution, with a small "old hardware" compatible desktop environment. (I am also mindful of the fact that Ubuntu is due to have another LTS release in a few months, 16.04, which inevitably will be even less friendly to old hardware; I did consider Linux Mint -- Debian Edition, but in general for seldom-used machines I prefer a "long term stable" release, rather than a more rapidly updating release -- so there seemed no advantage in going to Linux Mint. And neither of the Linux Mint desktop environments seemed ideally tuned to a 10 year old laptop...)

After reviewing the files on the existing Ubuntu 10.04 LTS Linux install, and copying off everything I wanted to keep, I planned to reinstall from scratch with Debian. To do that I need a Debian Linux boot image.

One of the faster ways to do that is to use jigdo to reassemble a CD image from the combination of a template file and a nearby Debian Linux mirror. The resulting CD images can also be copied to a USB stick, with dd and boot on any system that supports booting CDs.

Jigdo needs:

  1. The jigdo-lite program to run on an existing computer

  2. The URL of a .jigdo file describing what needs to be included, specific to the Debian Linux release and architecture you want.

  3. A nearby Debian Linux mirror

  4. A bunch of network bandwidth -- roughly equivalent to downloading a full CD, but hopefully less due to not downloading unused parts of the CD.

I wanted to install Debian Jessie (8.2) which was released during 2015. And the HP NC6220 laptop has an Intel CPU. So the only thing I had to verify was whether I needed the "i386" (really i686, with a legacy name) or the x86-64 release.

The way to tell on an existing Linux system if the CPU has 64-bit support is that the flags: line in /proc/cpuinfo needs to contain "lm" -- for "Long Mode" -- and mine does not:

ewen@wat:~$ grep flags /proc/cpuinfo 
flags       : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca
cmov clflush dts acpi mmx fxsr sse sse2 ss tm pbe nx up bts est tm2
ewen@wat:~$ grep "flags.*lm" /proc/cpuinfo 
ewen@wat:~$ 

so the "i386" version is the only one that will run.

Assuming an existing Debian system -- I used a Debian Linux server that I had handy -- Jigdo usage is then:

sudo apt-get install jigdo-file

mkdir /var/tmp/debian
cd /var/tmp/debian

# Optionally use a proxy (eg, to get a more direct path to the mirror)
http_proxy=http://PROXY:3128/
export http_proxy

jigdo-lite http://cdimage.debian.org/debian-cd/8.2.0/i386/jigdo-cd/debian-8.2.0-i386-CD-1.jigdo

where the URL is one taken from the list of i386 Debian Linux 8.2 CD templates, which in turn was found in the list of Debian Linux Stable Official Releases. It is the first CD -- and providing a network connection is available during the installation to install additional packages, only the first CD should be required (for booting and base system installation).

Once run, jigdo-lite will download the specified .jigdo file, report some details about what is contained in it, eg:

Images offered by `http://cdimage.debian.org/debian-cd/8.2.0/i386/jigdo-cd/debian-8.2.0-i386-CD-1.jigdo':
  1: 'Debian GNU/Linux 8.2.0 "Jessie" - Official i386 CD Binary-1 20150906-10:02 (20150906)' (debian-8.2.0-i386-CD-1.iso)

Further information about `debian-8.2.0-i386-CD-1.iso':
Generated on Sun, 06 Sep 2015 10:35:46 +0000

and then offer to scan an existing directory for packages that you might already have. (See the Jigdo Howto for details, although note that it too is 10 years old...).

Finally it asks for a Debian Linux mirror to download the files from, and the one it picked automatically -- apparently from this Debian system's /etc/apt/sources.list -- was fine, ie:

The jigdo file refers to files stored on Debian mirrors. Please
choose a Debian mirror as follows: Either enter a complete URL
pointing to a mirror (in the form
`ftp://ftp.debian.org/debian/'), or enter any regular expression
for searching through the list of mirrors: Try a two-letter
country code such as `de', or a country name like `United
States', or a server name like `sunsite'.
Debian mirror [http://linux.citylink.co.nz/debian]: 

After that, there is a lot of downloading and a lot of progress output.
All going well it should end with:

Finished!
The fact that you got this far is a strong indication that `debian-8.2.0-i386-CD-1.iso'
was generated correctly. I will perform an additional, final check,
which you can interrupt safely with Ctrl-C if you do not want to wait.

OK: Checksums match, image is good!   

It is also possible to verify the CD image manually with:

wget http://cdimage.debian.org/debian-cd/8.2.0/i386/jigdo-cd/SHA256SUMS
wget http://cdimage.debian.org/debian-cd/8.2.0/i386/jigdo-cd/SHA256SUMS.sign
sha256sum debian-8.2.0-i386-CD-1.iso 

and compare that calculated checksum with the one in SHA256SUMS; or semi automatically with:

grep debian-8.2.0-i386-CD-1.iso SHA256SUMS | sha256sum -c -

which should return:

debian-8.2.0-i386-CD-1.iso: OK

To complete the verification it is necessary to check the PGP signature of the SHA256SUMS file, which can be done on a Debian Linux system with:

sudo apt-get install debian-keyring gnupg
gpg --keyring /usr/share/keyrings/debian-role-keys.gpg --verify SHA256SUMS.sign 

and should tell you something like:

gpg: Signature made Sat Sep 12 03:13:14 2015 NZST using RSA key ID 6294BE9B
[...]
gpg: Good signature from "Debian CD signing key <debian-cd@lists.debian.org>"

However unless you have a complete chain of PGP trust back to that key (ie, you trust a key that signed a key that signed a key that... signed that key), it will also probably tell you "This key is not certified with a trusted signature!" -- so you'll need to take the last step on trust. (Helped a bit by the Debian CD Verification page listing that particular key as one that Debian uses to sign keys -- and that page is delivered over HTTPS for some protection against being modified in transit.)

Note that you should not use:

  1. /usr/share/keyrings/debian-keyring.pgp (because it is empty as all the legacy PGP keys have been retired); or

  2. /usr/share/keyrings/debian-keyring.gpg (because it is a role account not a person, and the debian-keyring.gpg file has only person keys)

for the verification (see eg, Debian bug 609451 for hints on the latter problem). Debian could certainly document this verification process better than they do.

The remaining step is to write that ISO image out to a USB stick:

sudo dd if=debian-8.2.0-i386-CD-1.iso of=/dev/DEVICE bs=4M; sudo sync

where DEVICE is the device name of the USB stick plugged in. Triple check that you have the right device name for your USB stick, and not one of your hard drives!

Once written, ending with something like:

161+1 records in
161+1 records out
678428672 bytes (678 MB) copied, 149.318 s, 4.5 MB/s

the USB stick can be removed from the "jigdo machine", and plugged into the system you want to install on -- and the system rebooted.
Providing the system is set to boot from a "USB Hard Drive" fairly early in the boot search order it should "just work" when the target system is rebooted.

Because of the old hardware I want a lightweight Debian Desktop so I am going to use Xfce. The easiest way to ensure tht is selected is to wait for the boot splash menu to come up (with "Install", "Graphical Install", "Advanced Options", etc), and then press the TAB key to edit the boot command line and add:

desktop=xfce

to the end of that, as a hint to the installer to pre-select that desktop environment. Then press Enter to start the boot.

During the early stages of the setup, it will scan the hardware for suitable drivers, and there may be some warnings displayed. With this HP NC6220 laptop the main hardware warning I got was that the firmware file ipw2200-bss.fw was not present. Which is the "non-free" firmware for the wireless card. I skipped that during the install as I am using the wired networking for the installation (if you have the right file it is also possible to load it from removable media, such as another USB memory stick); but I will need to install the firmware-ipw2x00 package later.

Since this is a fresh installation to completely replace the existing system, and I want to encrypt the hard drive (for travel!) I chose the "Guided -- use entire disk and set up encrypted LVM" option. In view of the "full" disk encryption (/boot is not encrypted), and small drive, I simply put everything in one partition -- on small disks splitting it up further usually just leads to a lot of juggling between tiny disk partitions. (Note that once the encrypted LVM option and partitioning is confirmed, to be written to the disk, there is a long process of overwriting the disk with random data -- it can be skipped but will potentially make it easier to bypass the encryption. This happens before the partioning scheme on disk is actually confirmed! On this 160GB spinning disk it took a couple of hours, and kept the CPU constantly busy. I let it run partly for the increased security, and partly as a convenient "full disk write" test -- which is always useful on older hardware before relying on it again.)

Once the disk "randomisation" and partitioning was done, the rest of the install needed about 1000 packages (some from the first CD, some downloaded), including about 10 minutes of downloads. The final set of questions before it started the download/install process was about the desktop environment to install -- Xfce was pre-selected due to the boot arguments -- and which other items to install (eg, SSH server, print server, webserver). The package install process took perhaps another 15-20 minutes (old, slow, spining rust, hard drive!), but I left it doing its own thing.

After the install completed I needed to set a few other things to make the installation useful:

  • Configure the panel, to be at the bottom, from scratch, including an empty text launcher (much easier than hunting in menus!)

  • apt-get install sudo vim (to install useful tools that were missed); followed by adding my user into the sudo group (and then logging out/logging in). Also sudo update-alternatives editor /usr/bin/vim.basic to make vim the default editor.

  • Add the "non-free" package archives, and then sudo apt-get install firmware-ipw2x00 to enable the wireless card (then reboot, and change the wireless monitor panel widget to monitor `eth1). Also configure it to connect to my Wifi, by right cicking, then Applications -> Settings -> Network Connections and adding a Wifi connection for the SSID. (Plus remember to turn on the Wifi on the hardware switch before expecting it to work!)

  • Configure the desktop Window Manager for "Focus Follows Mouse" (right click, then Applications -> Settings -> Window Manager -> Focus).

The system will need a bit more configuration to be useful (eg, email), but most things now seem to work -- other than the trackpad scrolling, and possibly some of the function keys (eg, suspend). I suspect those probably just need some appropriate driver to be installed.

ETA, 2016-01-11: Fixing the touchpad scrolling to work the way it used to was simple: Applications -> Settings -> Mouse and Touchpad -> Touchpad -> Scrolling -> Edge Scrolling. The default seems to be Two Finger scrolling, which seems sensible but not what I had got used to on this laptop -- nor matching the printed stencils on the touchpad. While there, I also set the option to reverse the scroll direction -- like modern Macs -- which I will try for consistency with Apple devices. That is Applications -> Settings -> Mouse and Touchpad -> Buttons and Feedback -> Reverse Scroll Direction.

Also of note, to get at the numeric pad via Fn keys, it is necessary to either (a) hold Shift-Fn down while pressing the key, or (b) press Fn-Num Lk to switch into number mode. If Fn-Num Lk is used, then the keys will no longer respond as letters, only as numbers. Without Shift, ie, only Fn, the keys will respond as if it is an extended (101-key) keyboard, without numlock enabled, and act as a cross arrow key navigation -- which is not very useful. (I do not remember if it was like this with Ubuntu 10.04 or not; mostly I did not need the psuedo numeric keypad.)

The volume hard buttons, and screen brightness Fn combinations seem to just work (although with no indication of new brightness state; the power manager panel widget will display the current brightness state, but it is only refreshed each time you go into the panel widget). An old Gentoo Linux on HP NC6220 article has some useful (if dated) technical details about Linux on the laptop, including that most of these keys work automatically.

To get the Fn-F3 key to suspend, it is necessary to change the "Do Nothing" setting to "Suspend" in Applications -> Settings -> Power Manager -> General -> "When Suspend Button is Pressed". (I also tried this with "When laptop lid is closed", but that still only seems to work the first time it is used after the laptop is first booted -- as with Ubuntu 10.04 LTS -- and it did not properly resume from sleep. So I've set those back to "lock screen", and will continue using Fn-F3 to suspend when required.)

While there I also change the "System Sleep Mode" (in the "System" tab), and changed to "Hibernate" on critical power, as if the power is under 10% chances are that I do not have easy access to more power -- and this laptop is old enough that the batteries do not last very long (possibly not long enough to use without the power adapter at all; I'll need to do a few charge/discharge cycle tests on the batteries and see if it is even worth travelling with the extended battery -- ie if it gives enough extra time to be worth the weight; maybe it would be more useful to just travel with an extension board/cord).