7.1.2 APT
APT is the Advanced Package Tool and provides the apt-get
program. apt-get
provides a simple way to retrieve and install
packages from multiple sources using the command line. Unlike
dpkg
, 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 /etc/apt/sources.list
. apt-get
will call dpkg
directly after downloading the .deb archives[4] from the configured sources.
Some common ways to use apt-get
are:
-
To upgrade all the packages on your system, run:
apt-get upgrade
-
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:
apt-get dist-upgrade
Note that you must be logged in as root to perform any commands that modify the
system packages.
The apt tool suite also includes the apt-cache
tool 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. Some common ways to
use apt-cache
are:
-
To find packages whose description contain word:
apt-cache search word
-
To print the detailed information of a package:
apt-cache show package
For more information, install the apt
package and read
apt-get(8)
, sources.list(5)
and install the
apt-doc
package and read
/usr/share/doc/apt-doc/guide.html/index.html
.