of packages in Debian and Ubuntu servers
There are multiple tools that are used to manage Debian packages, from graphic or text-based interfaces to the low level tools used to install packages. All the available tools rely on the lower level tools to properly work.
dpkg itself is a low level tool; higher level tools, such as APT, are used to fetch packages from remote locations or deal with complex package relations. End users are encouraged to use tools like aptitude or synaptic, having a more sophisticated way of dealing with package relationships and a friendlier interface.
The Debian package “dpkg” provides the
dpkg program, as well as several others necessary for run-time functioning of the packaging system,
dpkg-deb packs and unpacks binary packages
dpkg-gencontrol reads the information from an unpacked Debian tree source and generates a
binary package control package, creating an entry for this in Debian/files.
dpkg-shlibdeps calculates the dependencies of runs with respect to libraries.
dpkg-genchanges reads the information from an unpacked Debian tree source that once
constructed creates a control file (.changes).
dpkg-buildpackage is a control script that can be used to construct the package automatically.
dpkg-distaddfile adds a file input to debian/files.
dpkg-parsechangelog reads the changes file (changelog) of an unpacked Debian tree source and creates a conveniently prepared output with the information for those changes.
- dpkg -l adduser
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed |/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad) ||/ Name Version Description================================================================ii adduser 3.64 Add and remove users and groups
- dpkg -i ‘deb fileName’ to install the deb package. dpkg –install foo_VVV-RRR.deb.
- Print out the control file (and other information) for a specified package: dpkg –info foo_VVV-RRR.deb
- Unpack (but do not configure) a Debian archive into the file system of the hard disk: dpkg –unpack foo_VVV-RRR.deb Remove a package (but not its configuration files):
dpkg –remove foo.
- Remove a package (including its configuration files): dpkg –purge foo.
- List the installation status of packages containing the string (or regular expression) “foo*”: dpkg –list ‘foo*’.
APT is the Advanced Package Tool and provides the
apt-get provides a simple way to retrieve and install packages from multiple sources using the command line. Unlike
apt-get does not understand .deb files, it works with the packages proper name and can only install
.deb archives from a source specified in
apt-get will call
dpkg directly after
downloading the .deb archives from the configured sources.
To upgrade all the packages on your system, run:
To install the foo package and all its dependencies, run:
apt-get install foo
To remove the foo package from your system, run: apt-get remove foo
To upgrade all the packages on your system to a new Debian GNU/Linux release, run:
To remove the foo package and its configuration files from your system, run:
apt-get --purge remove foo
- The apt tool suite also includes the
apt-cachetool to query the package lists. You can use it to find packages providing specific functionality through simple text or regular expression queries and through queries of dependencies in the package management system.
To find packages whose description contain word:
apt-cache search word
- To print the detailed information of a package:
apt-cache show package
- To print the packages a given package depends on:
apt-cache depends package
- To print detailed information of the versions available for a package and the packages that reverse-depends on it:
apt-cache showpkg package
aptitudeis a package manager for Debian GNU/Linux systems that provides a frontend to the apt package management infrastructure.
aptitudeis a text-based interface using the curses library, it can be used to perform management tasks in a fast and easy way.
aptitudeoffers access to all versions of a package.
aptitudelogs all its actions in
aptitudemakes it easy to keep track of obsolete software by listing it under “Obsolete and Locally Created Packages”.
aptitudeincludes a fairly powerful system for searching particular packages and limiting the package display. Users familiar with
muttwill pick up quickly, as
muttwas the inspiration for the expression syntax.
aptitudetracks which packages have been installed due to dependencies and removes them automatically when the packages that needed them are removed from the system.
aptitudecan automatically install Recommended: packages.
aptitudecan be used to install the predefined tasks available.
aptitudein full screen mode has
sufunctionality embedded and can be run by a normal user. It will call
su(and ask for the root password, if any) when you really need administrative privileges