The Debian Package Management System

Sometimes known as apt, sometimes known as the thing that makes Debian the best distribution going.

Debian package management commands:

apt-get update #gets latest list of packages from mirrors specified in /etc/apt/sources.list

apt-get dist-upgrade #installs any updates for the software you already have and any dependencies

apt-cache search packagename #searches the package list for information on package packagename

apt-get install packagename #installs package packagename and any dependencies

apt-get remove packagename #removes packagename and dependencies not required by other packages

apt-get --purge remove packagename #as above but also removes any configuration files

dpkg --list | grep ^i #lists installed software, probably worth paging through less, ' | less' on the end, minus quotes

apt is a nice front end to dpkg. dpkg does not manage dependencies for you. dpkg is best for installing or removing single packages where deps are not an issue.

dpkg -i packagename #install packagename

dpkg -r packagename #remove packagename

dpkg -P packagename #as above but also purge config files, -P same as --purge

dpkg-reconfigure packagename #takes you through the configuration options for packagename that were asked when the package was installed. It is also useful when you need to change th configuration settings for a particular package.

Another useful package is deborphan which lists orphaned libraries that are safe to remove. Deborphan is not installed by default so you have to apt-get install it. There are switches in the man page to get it to check a wider range of packages as it defaults to libs. Getting it to check regular packages will list a lot of stuff not safe to remove as it simply lists all software that is not a dependency of something else, so you may wipe out a whole heap of system utils like passwd and adduser as they are standalone.

Obviously, man apt, man dpkg and man deborphan are your friends. I have a very good sources.list if you are interstested in a good starting point.

There are 3 Debian flavours: stable, testing and unstable. Because of the stringent quality controls on Debian packages, stable is rock solid but very old, suitable for production servers. Testing is pretty solid and relatively new, suitable for desktops and non-critical or testing servers. Unstable is cutting edge but likely to contain serious bugs and inconsistencies. Ok for desktops, if a little flaky, but not servers.

To change bewteen stable, testing and unstable, simply change the instances of stable in your sources.list to testing or whatever or for completeness copy each line and then add testing or unstable into the new line instead of stable. Note moving backwards from unstable is not recommended. Be sure to have a Debian security mirror in your sources list.

Packages in stable have had no critical bugs files against them in 6 months or something similar. Packages in testing have had no critical bugs filed against them in 2 weeks. Package in unstable, well umm...

apt is an infinitely better package management system to rpm. The only problems with Debian are that you mostly have to configure everything by hand, there is no control centre or wizard driven configuration system, it's all editors and config files. There is also no hardware detection, you have to select your kernel modules during the installation routine. It's awkward if you don't know what you're doing. Watch out for Ubuntu Linux which is a new distro by a number of the main Debian developers with financial backing, which aims to change most of these things.

Didn't find what you wanted eh?

Google

If you really need help try joining your local Linux User Group, thats what they are for - asking questions and giving and requesting assistance from your peers. There are lists for the UK at http://www.lug.org.uk/ and worldwide at http://www.linux.org/


Click here to go home, or here to go back to Linux.

Home | About Me | Computing | Debauchery | links | Filthy Downloads | Help | Interviews | Legal | Prague | Stuff