Showing posts with label debian. Show all posts
Showing posts with label debian. Show all posts

30 November 2009

How to modify basic system settings with dpkg-reconfigure

You have probably been told at some point to dpkg-reconfigure a package. This command belongs to the debconf infrastructure and what it does is execute the package's configuration script. The script usually recreates data or configuration files belonging to the package, and it may ask you a few questions in the process. Reconfiguring packages is one way of configuring and customizing your installation besides editing configuration files directly, or using GUI tools like KDE systemsettings or GConf.

To get a nice formatted list of installed packages that can be configured, do

cd /var/lib/dpkg/info/ && ls *config | sed 's/\.config$//'

Here are the most useful of them, and what configuring them does.

apt-listchanges: This package is likely not preinstalled on your distribution but useful for displaying changelogs when upgrading your system. Configuring this package asks you how it should output the package changelogs (inline in apt's output, or in one of several viewers), whether and where to send mail notifications, as well as some other settings.

ca-certificates: Asks whether to trust new CA certificates, and presents you a list where you can select which certificate owners to trust. You probably will not want to change anything here.

console-data: Lets you select a keyboard map to use on the console.

console-setup: Lets you select a character set and font for the console. This comes in handy if the console does not display some extended characters, or the predefined font is a 512 glyph font (like Terminus) that prevents the console from using the full color palette.

debconf: Lets you select the desired frontend for debconf and how many questions you want to be asked when running dpkg-reconfigure. You probably want to select the dialog frontend which is easy to use and can run on a plain console.

fontconfig-config: Allows you to configure X font hinting, subpixel rendering and whether you prefer pretty outline or ugly bitmap fonts.

keyboard-configuration: Lets you select model and language of the keyboard, what to use as Alt Gr and Compose, and whether the X server can be terminated using Ctrl-Alt-Backspace.

libpaper1: Sets the system-wide standard paper size (default: A4).

linux-sound-base: Asks which sound system should be used by default (ALSA or OSS).

locales: Asks which locales should be supported on your system, then generates these locales. Unselecting locales you will not use results in a few less megabytes of wasted storage space.

man-db: Asks you whether to use preformatted manpages, then updates the manual database.

popularity-contest: Asks you whether to participate in the Debian package popularity contest. Anonymous package statistics are sent once a week so the Debian project can decide which packages are popular enough to be included in the main distribution.

resolvconf: Asks you whether /etc/resolv.conf should be updated dynamically, which is likely what you want if you get the DNS servers via DHCP.

tzdata: Lets you select your time zone.

x11-common: Sets who is allowed to start the X server. The default "console users only" is fine and not too insecure.

19 November 2009

Boot Debian faster with Upstart

The Upstart daemon has been in development for quite some time as a contemporary replacement for the classical System V init. Being fully backwards compatible with existing init scripts, Upstart introduces support for event based, parallel execution of startup tasks in the form of "jobs" stored in the /etc/init directory.

Looking at the job scripts, I see it doesn't do much more so far than entering the default runlevel and executing the legacy System V scripts, but a speedup just before the graphical login is already achieved by allocating only one virtual console by default. Also, there seems to be less of a delay directly after the kernel is done initializing. I didn't notice any issues after having used Upstart for a month now, so I'll tell you how to install it on Debian Sid. Upstart is also available in some other Debian based distros and Fedora, use the respective package manager there. I'm using Aptitude for this article.

If Aptitude isn't installed on your system, get it using your GUI software manager or do a sudo apt-get install aptitude, then start it. Use / (the slash) to search for the upstart package, then press + (plus) to mark it for installation. Now aptitude will complain about a conflict with the sysvinit package; that's because upstart wants to remove sysvinit, but sysvinit is an essential system package. Ignore that, search for sysvinit and mark it for removal using - (minus). Aptitude will ask you to confirm the removal by inputting the phrase "Yes, I am aware this is a very bad idea". Do that and the conflict will resolve. Press G and verify in the shown summary whether sysvinit will really be removed (shown in purple) and upstart will really be installed (shown in green). If you screwed something up, press q and undo the selections, else press g another time to start the installation. When done, you can quit Aptitude by pressing q in the main view. Next reboot will be slightly faster :-)