The one system that binds all software on a debian system together is its package management. A Debian system uses "packages" to keep track of the files installed on your system and generally makes a piece of software feel at home on your system. These packages can be installed or removed (unless, of course some other package requires it) at will. In fact, the majority of the Debian installation process is installing the most basic packages that allow Debian to function.
Debian package management consists of several layers. The lowest layers, most of which you won't want to touch, are made up of "dpkg" and associated programs. On top of those layers are "apt", "dselect" and the upcoming "aptitude" tools. These tools work with DebianPackage files.
All of those tools are documented by a ManPage, so if you have questions, you should consult them (eg. 'man apt'). If you're new, there are some commands that have proven most useful for everyday use. Thes are grouped generally as:
Full-Screen Front-Ends
These are both console (ncurses) and GUI based. There are a number of alternatives, similar in regards, different in others. For users of ?RpmBasedLinuxDistros, analogs include ?RedCarpet and ["?Up2Date"].
'aptitude' calls a friendly frontend to apt. Note that the version in DebianPotato is very primitive; it's much improved in later releases.
- 'dselect' (see ["DSelect"]) calls a not so nice frontend to apt (if in panic, pressing ESC several times will usually bring you back to a safe place)
[http://packages.debian.org/adept adept] is a nice GUI-based frontend with several nice options.
[http://www.nongnu.org/synaptic Synaptic] is another GUI-based frontend.
other frontends are available (e.g. gnome-apt), try to use one of the above or 'apt-cache search' to find one of them
Command-line Front-Ends
Generally, tools which integrate a number of operations (package list management, package retrieval, package installation, package configuration) in a single command. The primary command is apt-get, which has a number of useful invocations.
'apt-get update' (see ?AptGet) to update apt's internal database of available packages
- 'apt-get -u upgrade' to bring all currently installed packages up to date
- 'apt-cache search jabber' to find a program that gives you access to the jabber instant-messaging system
- 'apt-cache show gabber' to display more info about the GNOME jabber client
- 'apt-get install gabber' to install the package
- 'apt-get remove gabber' to remove it again
'apt-cache dumpavail > tmp-avail; dpkg --update-avail tmp-avail; rm tmp-avail' to make the changes made by apt-get update reflected in dpkg -p and dpkg -l invocations.'
"Apt Help":http://www.spack.org/wiki/UsingApt
You can also use ["Wajig"], for an unified and more logical command-line interface to all package management functions.
Low-level Tools
Largely dpkg and friends, these are commands that perform a single task. They are most directly comparable to Redhat's "rpm" command.
- 'dpkg-reconfigure locales' to reconfigure ["locale"]s
- 'dpkg-reconfigure exim' to reconfigure the exim mail-transfer agent. This command isn't currently part of dpkg; it's provided by debconf.
- 'dpkg', (see ["DPkg"]) invoked with various command-line arguments. If you find a place to download debian-packages that is not accessible via apt, you can download the packages and install them directly. Note that this method will not automagically resolve dependencies between packages etc, therefore use apt or dselect if possible.
- 'dpkg --listfiles textutils' to list all the files provided by the textutils package. This only works for packages which are already installed. This can be useful to find out what form a package's documentation has been provided in.
- 'deborphan' is something you should apt-get install, as it will give you a list of library packages that no longer have higher-level packages depending on them. Use it when you're low on space.
- 'dpkg -S /bin/ls' to know what package a certain file belong to.
Contents of a debian file
To get the contents of the file "abc.deb", you have to enter
dpkg-deb -c abc.deb
Reconfiguring of debconf
To reconfigure debconf, so that it informs you of most changes of the new packages, you have to enter
sudo dpkg-reconfigure debconf
Chose "medium" here
Package Management with apt-get and dpkg
Package resource list for APT
The file /etc/apt/sources.list is the definition file of the sources for apt. For further information about this file type
man 5 sources.list
Retrieve new lists of packages:
To fetch the new lists of all the packages from sources.list enter as ?RootUser
sudo apt-get update
This command checks for new release-files on the given servers. Luckily the command is clever enough to check if the release-file has changed after the last update.
Upgrade of all the files:
To make an update of all the changed packages, enter the line
sudo apt-get upgrade -u
The additional flag -u shows a list of upgraded packages as well. If you want to run the update in a cron-job, you should use the flags -dy. With this flags the new packages will be downloaded but not installed. You can install them later by writing apt-get update -u.
Distribution Upgrade of all the files:
To make an upgrade of your actual distribution (e.g from potato to woody or when using unstable) replace upgrade with dist-upgrade when entering your command. So you have to type
sudo apt-get dist-upgrade -dy sudo apt-get dist-upgrade -u
for an distribution upgrade.
Add a package:
How can you add a package to your system without the gui-programms? All you have to do is find out the name of this package and enter the command
sudo apt-get install sylpheed-claws
to add the package sylpheed-claws.
Remove a package:
To get rid of the package foo which is no longer needed, enter the command
sudo apt-get remove foo
If the package is needed by other packages you will be prompted to remove this package and all packages which depend on it.
Forced removing of a package:
While making an distribution upgrade it could happen that you have to remove a package first. But sometimes this is not possible with apt-get remove since the package has unmet dependencies or is not installed completely. You can remove the package foo by using the command
sudo dpkg --force-all --remove foo
Read the contents of a installed package:
Sometimes you want to know which files are in the package foo. To get this information enter the command
dpkg -L foo
Get the description of a package:
You don't know what the package foo is for? Just write
dpkg -p foo
Search the package of a file:
Have you ever wondered to which package belongs a given file? To get this information (e.g. for /usr/bin/apt-get), start the command
dpkg -S /usr/bin/apt-get
and it will tell you that this file is part of the package apt.
?CategoryQuickPackageManagement | CategoryPackageManagement