Updating to Debian Lenny

Last week-end, Debian Lenny 5.0 was finally released. I use Debian on most servers I manage at work. A few of them were already using Lenny when it was still the testing branch, but most are still on Debian Etch. So this morning I decided to test upgrade one of the less critical Etch systems to Lenny. That system is only used to store back-up files from other systems, so it would not be a problem if that machine was off line for a couple of hours.
According to the release notes, you should rather use aptitude instead of apt to upgrade, so that’s what I did. All went well, until suddenly the package upgrade hung while installing new udev configuration files. I could Ctrl-C the process to continue, but from that moment on, more and more post installation scripts started hanging and had to be interrupted.

I noticed that also simple commands, such as ps and getent passwd were hanging too and that I could not log in via SSH anymore. Fortunately, the existing SSH connections continued to work, so I was not locked out yet.

I straced getent passwd and noticed that it hung while trying to connect to the remote LDAP server. The problem was apparently that Lenny’s libnns_ldap tried to connect via LDAPS to port 389, while LDAPS uses port 636 by default. It seems that you need to specify the port number 636 now to make LDAPS work right, so for example: ldaps://remote.host:636. I fixed this in libnss-ldap.conf and pam_ldap.conf, and then I could finish the upgrade without any problem. Apparently this is a known problem.

So definitely modify your configuration first if you are using LDAP authentication and want to upgrade to Lenny. I should probably also fix my nsswitch.conf so that applications don’t start to hang if the LDAP server is unreachable…

In spite of this problem, the whole upgrade was done in less than 1 hour. Without that problem, I guess it would have taken about 20 minutes less. Quite impressive!

Getting nice anti-aliased fonts in Debian

Since about a year I’m using Debian on an Apple Powerbook G4 PowerPC laptop. Mandriva does not have an active PowerPC port anymore, I don’t really like Ubuntu (and their PowerPC port does not get the same priority anymore as the x86 ports), so Debian was an obvious choice for me, and I have never regretted this.

One of the things that annoyed me however, was the default looks of fonts. Some fonts (especially in Firefox) did not look anti-aliased, while those that were, did not look as nice as I’m used to from Mandriva. At that time, I did not found anything better than compiling a more recent version of freetype (just standard ./configure, make, make install, no patches for enabling any patented stuff) and replacing the contents of /etc/fonts/conf.d by the one from a Mandriva system. And installing the Liberation fonts from Red Hat’s tarball.

Today, things are a bit easier: a Liberation package is now available in the Debian repository as are up to date packages of Freetype. And I learned a bit more about Debian’s Freetype configuration, so I was able to tweak the default settings now, instead of just replacing everything by Mandriva’s.

Here’s a quick howto. I assume you are using Debian Lenny, and have the unstable/sid repositories added to apt’s sources.list (use apt pinning so that testing is preferred over unstable).

  • Make sure you have the basic font packages installed: apt-get install ttf-dejavu ttf-liberation (the latter currently only exists in unstable)
  • Make sure you have a recent version of freetype installed. Run apt-cache policy libfreetype6 to see which versions are currently available in Debian. I installed version 2.3.6 from Unstable: apt-get install -t unstable libfreetype6
  • Install a recent fontconfig version. Run apt-cache policy fontconfig to see which versions are available. I installed version 2.6.0 from unstable: apt-get install -t unstable fontconfig libfontconfig1 fontconfig-config
  • Go the the directory /etc/fonts/conf.d. You’ll see that it contains all symbolic links to /etc/fonts.conf.avail which contains some more interesting configuration files which we’ll activate by adding a symbolic link. Especially I want to use the autohinter, enable RGB subpixel hinting and don’t want to use bitmap fonts:
    ln -s ../conf.avail/10-autohint.conf<br/>
    ln -s ../conf.avail/10-sub-pixel-rgb.conf<br/>
    ln -s ../conf.avail/70-no-bitmaps.conf
  • Now in GNOME go to the menu System – Preferences – Appearance and go to the Fonts tab and play a bit with the settings until you are happy with them. I used Deja Vu Sans Book 9pt for desktop and application fonts and Liberation Mono 9pt as fixed width font. Rendering is set to subpixel smoothing, and in the details panel I chose suppixel (LCD) smoothing, full hinting and RGB subpixel order. If you are using KDE 3, you can make similar settings in KDE’s Control Center under Look & Feel – Fonts (make sure anti-aliasing is enabled and click on the Configure button).
  • In Firefox/Iceweasel 3 go to Edit – Preferences – Content and click on the Advanced button in the Fonts & Colors section. Configure the fonts you like best (I chose Liberation fonts, and set sans-serif by default) and play a bit with the default and minimum font size (I chose 15 pt as default size, and 9 pt as minimum).

Enjoy your nice fonts!