I use Debian since a while and i must say that i consider that it is the simpler distribution that i know. Well you can ever become some difficulties to install some drivers from proprietary stuff or new brand hardware but once you have your system running, believe me it is the simplest for maintaining, installing and removing in your system. And dpkg/apt are not least in the last assumption.
The first front-end at which you will stick is dselect, which is a menu based program.
I will not be extended with it because it is simple. What you need to know is that you can update the list of available packages with update, you can select which of them you will install with select. In this option, you go out of the help (going out of the help is the more tricky part) with the space bar (ubuntu like i thing it is with “enter”).
You can look for a package named for example firebird tipping “/fire” (without quote), and it will look for the first in the list named fire-something package and typing “n” you go through this list. Of course it is better typping “firebird”. If you want to select for installing you tip “+” (”-” for deinstalling) and dselect present you the list of conflicting, recommended … packages that you can choose with the same +- method (you go out of the list by typing enter). Once you’re satisfied, you tip “enter” and it go through the install process.
dselect is easy, not always the more flexible but the more secure and stable you can dream about. But let me present you the second soft of the debian classical tools collection: DPKG.
dpkg is a command line based tool. You can save the list of the installed packages on your system with:
dpkg –get-selections > selections.dpkg
Don’t be so shy and edit this text file. If you want to recover the state of your package selections you type:
dpkg –set-selections (no description available)
pn lynx-cur-wrapp (no description available)
un lynx-ssl (no description available)
and if you wish to know all the files that install or simply modify the installation of a package:
dpkg -L lynx
/.
/usr
/usr/bin
/usr/bin/lynx.stable
/usr/share
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/lynx.1.gz
…
/etc
/etc/lynx.cfg
…
You want the information on a package (lynx for example)?
dpkg -p lynx
Package: lynx
Priority: optional
Section: web
Installed-Size: 4292
Maintainer: James Troup
Architecture: i386
…
Description: Text-mode WWW Browser
Lynx is a fully-featured World Wide Web (WWW) client for users
running cursor-addressable, character-cell display devices (e.g.,
…
That is what a look at /var/lib/dpkg/available will give you after a painful search.
The status of the package can be found with:
dpkg -s lynx
Imagine that you find a strange file in you system (bad news…), and you want to make sure which package it comes from:
dpkg -S /etc/lynx.cfg
lynx: /etc/lynx.cfg
And you can run again the pre-installation process thanks to:
dpkg-reconfigure xserver-xfree86
It will replay the pre/post install script at wich you can take a look at /var/lib/dpkg/info/. For example, we had in my company a problem with bacula director’s instalation because there was a mistake in /var/lib/dpkg/info/bacula-director-mysql.postinst. We had this faultly line:
MYSQL_PSWD_STRING=”-p”$MYSQL_ROOT_PASSWORD”"
So the given root password was never the one bacula use to connect to mysql as root, we had to transform in:
MYSQL_PSWD_STRING=”-p $MYSQL_ROOT_PASSWORD”
(without the escaped quote)
Of course we have tried to reach the packager. But that’s not all folks. Now comes the bestpart: <i>apt</i>. You do not have to download the lynx_2.8.5-sarge1_i386.deb and after install with dpkg -i. No! Just lauch your branded 16k modem to become the line up and type:
apt-get install lynx
You have heard about a new security update, retrieve it with…
apt-get update
Same effect as…
dselect upgrade
…with:
apt-get upgrade
If you wish to look into the code:
apt-get source lynx
And all the magic stuff is controlled through /etc/apt/sources.list.
deb file:///cdrom/ sarge main
deb http://ftp.de.debian.org/debian/ sarge main non-free contrib
deb-src http://ftp.de.debian.org/debian/ sarge main non-free contrib
deb http://security.debian.org/ sarge/updates main contrib non-free
Or better with a mirror:
deb http://ftp.rediris.es/debian/ stable main non-free contrib
deb-src http://ftp.rediris.es/debian/ stable main non-free contrib
Or the best, an apt-proxy which proxies your downloads (karkoma, will you write an apt-proxy article, don’t you?):
deb http://aptserv.dmz:9999/debian/ sarge main non-free contrib
deb-src http://aptserv.dmz:9999/debian sarge main non-free contrib
deb http://aptserv.dmz:9999/debian-volatile sarge/volatile main
deb http://aptserv.dmz:9999/security/ sarge/updates main contrib non-free
Note the debian-volatile: this is for the highly upgraded packages like clamav, dcc,…
Another file that can be quite useful is /etc/apt/apt.conf. For example if you have an http proxy for going out in internet you will add in this file:
Acquire::http::Proxy “http://proxy.yourcompany:3128″;;
Or you can simply set the http_proxy=http://proxy.yourcompany:3128 in your environment). In the precedent case of the apt-proxy, if you have an http_proxy and of course you don’t want to proxy your apt-proxy you can control it by adding in this file:
Acquire
{
http
{
Proxy::no_proxy=comm.dmz;
}
}
Or add no_proxy=http://aptserv.dmz:9999 in your environment). Note that you have two syntaxes (the first one is the old one and the second one is the new). Don’t be confused with upgrade and update: update is when the source-list has been changed to synchronize the list of the mirrors and upgrade is to synchronize the list of the new availables packages.
One good tool in case of problems with apt is apt-config. dump> will dump for you your configuration with all the parameters (the defaults too):
$ apt-config dump
APT “”;
APT::Architecture “i386″;
APT::Build-Essential “”;
…
DPkg::Pre-Install-Pkgs:: “/usr/sbin/dpkg-preconfigure –apt || true”;
Acquire “”;
Acquire::http “”;
Caution! When you upgrade to a new distribution of debian (it occurs once every two years more or less, that could be the only criticism of debian), change your source-list, perform an apt-get update, an apt-get upgrade and after that an apt-get dist-upgrade.
One last word. Comes aptitude, a new tool (there is a lot of graphical tools that i don’t know…). but for sarge it seems to me that the old ones do a better works (i must take a closer look…).
Enjoy Debian without moderation…
