-<!doctype debiandoc system>
<!-- -*- mode: sgml; mode: fold -*- -->
+<!doctype debiandoc PUBLIC "-//DebianDoc//DTD DebianDoc//EN">
<book>
<title>APT User's Guide</title>
<author>Jason Gunthorpe <email>jgg@debian.org</email></author>
-<version>$Id: guide.sgml,v 1.1 1998/07/02 02:58:12 jgg Exp $</version>
+<version>$Id: guide.sgml,v 1.7 2003/04/26 23:26:13 doogie Exp $</version>
<abstract>
This document provides an overview of how to use the the APT package manager.
<p>
For more details, on Debian GNU/Linux systems, see the file
-/usr/doc/copyright/GPL for the full license.
+/usr/share/common-licenses/GPL for the full license.
</copyright>
<toc sect>
<p>
The Debian packaging system has a large amount of information associated with
each package to help assure that it integrates cleanly and easily into
-the system. The most prominent of features is the dependency system.
+the system. The most prominent of its features is the dependency system.
<p>
The dependency system allows individual programs to make use of shared
elements in the system such as libraries. It simplifies placing infrequently
used portions of a program in separate packages to reduce the
number of things the average user is required to install. Also, it allows
-a choices in for such things as mail transport agents, X servers and
+for choices in mail transport agents, X servers and
so on.
<p>
requires another package to be installed at the same time to work properly.
<p>
-For instance, mail-crypt is an emacs extension that aids in encrypting email
-with PGP. Without PGP installed mail-crypt is useless, so mail-crypt has a
-simple dependency on PGP. Also, because it is an emacs extension it has a
+For instance, mailcrypt is an emacs extension that aids in encrypting email
+with GPG. Without GPGP installed mail-crypt is useless, so mailcrypt has a
+simple dependency on GPG. Also, because it is an emacs extension it has a
simple dependency on emacs, without emacs it is completely useless.
<p>
<p>
<prgn>apt-get</> provides a simple way to install packages from the command
line. Unlike <prgn>dpkg</>, <prgn>apt-get</> does not understand .deb files,
-it works with the packages proper name and can only install .deb archives from
+it works with the package's proper name and can only install .deb archives from
a <em>Source</>.
<p>
<example>
# apt-get update
Get http://ftp.de.debian.org/debian-non-US/ stable/binary-i386/ Packages
-Get http://llug.sep.bnl.gov/debian/ frozen/contrib Packages
-Updating package file cache...done
-Updating package status cache...done
-Checking system integrity...ok
+Get http://llug.sep.bnl.gov/debian/ testing/contrib Packages
+Reading Package Lists... Done
+Building Dependency Tree... Done
</example>
<p>
-Once updated there are several useful commands that can be used,
+Once updated there are several commands that can be used:
<taglist>
<tag>upgrade<item>
Upgrade will attempt to gently upgrade the whole system. Upgrade will
This can be used daily to relatively safely upgrade the system. Upgrade
will list all of the packages that it could not upgrade, this usually
means that they depend on new packages or conflict with some other package.
-<prgn>Dselect</> or <tt>apt-get install</> can be used to force these
+<prgn>dselect</> or <tt>apt-get install</> can be used to force these
packages to install.
<tag>install<item>
-Install is used to install single packages by name. The package is
+Install is used to install packages by name. The package is
automatically fetched and installed. This can be useful if you already
know the name of the package to install and do not want to go into a GUI
to select it. Any number of packages may be passed to install, they will
all be fetched. Install automatically attempts to resolve dependency problems
with the listed packages and will print a summary and ask for confirmation
-if anything other than it's arguments are changed
+if anything other than its arguments are changed.
<tag>dist-upgrade<item>
-Dist-upgrade is a complete upgrader designed to make simple upgrading between
+Dist-upgrade is a complete upgrader designed to simplify upgrading between
releases of Debian. It uses a sophisticated algorithm to determine the best
set of packages to install, upgrade and remove to get as much of the system
to the newest release. In some situations it may be desired to use dist-upgrade
</taglist>
<p>
-<prgn>apt-get</> has several command line options that are detailed in it's
+<prgn>apt-get</> has several command line options that are detailed in its
man page, <manref name="apt-get" section="8">. The most useful option is
<tt>-d</> which does not install the fetched files. If the system has to
download a large number of package it would be undesired to start installing
<example>
Please give the distribution tag to get or a path to the
package file ending in a /. The distribution
- tags are typically something like: stable unstable frozen non-US
+ tags are typically something like: stable unstable testing non-US
Distribution [stable]:
</example>
refers to packages that contain encryption technology or other things that
cannot be exported from the United States. Importing these packages into the
US is legal however.
-<footnote>As of this writing the non-US distribution has
-not been created, the only way to access it is by specifying
-stable/binary-i386/ at this prompt and by specifying a URL ending in
-debian-non-US </footnote>
<p>
<example>
<p>
The components list refers to the list of sub distributions to fetch. The
-distribution is split up based on software copyright, main being DFSG free
+distribution is split up based on software licenses, main being DFSG free
packages while contrib and non-free contain things that have various
restrictions placed on their use and distribution.
the [C]onfig and [R]emove commands have no meaning, the [I]nstall command
performs both of them together.
+<p>
+By default APT will automatically remove the package (.deb) files once they have been
+successfully installed. To change this behavior place <tt>Dselect::clean
+"prompt";</> in /etc/apt/apt.conf.
+
</chapt>
<!-- }}} -->
<!-- The Interfaces {{{ -->
how much is left to do.
<!-- ===================================================================== -->
-<sect>The Pre-Checks
+<sect>Startup
<p>
-Before all operations, except update, APT performs a number of checks on the
-systems. These are designed to safe guard the operations it is about to
-undertake. At any time the full set of checks may be run by performing
-<tt>apt-get check</>.
+Before all operations except update, APT performs a number of actions to
+prepare its internal state. It also does some checks of the system's state.
+At any time these operations can be performed by running <tt>apt-get check</>.
<p>
<example>
# apt-get check
-Updating package file cache...done
-Updating package status cache...done
-Checking system integrity...ok
+Reading Package Lists... Done
+Building Dependency Tree... Done
</example>
<p>
-The first check is to ensure that the archive package lists are matched to
-the pre-generated data cache, if they are not then the cache is automatically
-refreshed. This may fail if <tt>apt-get update</> has not been run to
-synchronize with the <em>Sources</>. The next check verifies that the state of
-the system matches the cached state and automatically rebuilds the cached
-state if they are not synchronized. This check should never fail and it
-indicates a serious error if it ever does.
+The first thing it does is read all the package files into memory. APT
+uses a caching scheme so this operation will be faster the second time it
+is run. If some of the package files are not found then they will be ignored
+and a warning will be printed when apt-get exits.
<p>
-The final check performs a detailed analysis of the system integrity. It
-checks every dependency of every installed or unpacked package and considers
-if it is ok. Should this find a problem then a report will be printed out and
+The final operation performs a detailed analysis of the system's dependencies.
+It checks every dependency of every installed or unpacked package and considers
+if it is OK. Should this find a problem then a report will be printed out and
<prgn>apt-get</> will refuse to run.
<p>
<example>
# apt-get check
-Updating package file cache...done
-Updating package status cache...done
-Checking system integrity...dependency error
+Reading Package Lists... Done
+Building Dependency Tree... Done
You might want to run apt-get -f install' to correct these.
-Sorry, but the following packages are broken - this means they have unmet
-dependencies:
- libdbd-mysql-perl: Depends:perl
- xzx: Depends:xlib6
- libdbd-msql-perl: Depends:perl
- mailpgp: Depends:pgp-i Depends:pgp-us
- xdpkg: Depends:python
- squake: Depends:quake-lib Depends:quake-lib-stub
- debmake: Depends:fileutils
- libreadlineg2: Conflicts:libreadline2
- ssh: Depends:gmp2 Depends:xlib6g Depends:zlib1g
+Sorry, but the following packages have unmet dependencies:
+ 9fonts: Depends: xlib6g but it is not installed
+ uucp: Depends: mailx but it is not installed
+ blast: Depends: xlib6g (>= 3.3-5) but it is not installed
+ adduser: Depends: perl-base but it is not installed
+ aumix: Depends: libgpmg1 but it is not installed
+ debiandoc-sgml: Depends: sgml-base but it is not installed
+ bash-builtins: Depends: bash (>= 2.01) but 2.0-3 is installed
+ cthugha: Depends: svgalibg1 but it is not installed
+ Depends: xlib6g (>= 3.3-5) but it is not installed
+ libreadlineg2: Conflicts:libreadline2 (<< 2.1-2.1)
</example>
<p>
In this example the system has many problems, including a serious problem
with libreadlineg2. For each package that has unmet dependencies a line
is printed out indicating the package with the problem and the dependencies
-that are unmet. For brevity the version inter-relationships are omitted.
+that are unmet. A short explanation of why the package has a dependency
+problem is also included.
<p>
There are two ways a system can get into a broken state like this. The
-first is caused by <prgn>dpkg missing</> some subtle relationships between
+first is caused by <prgn>dpkg</> missing some subtle relationships between
packages when performing upgrades. <footnote>APT however considers all known
dependencies and attempts to prevent broken packages</footnote>. The second is
if a package installation fails during an operation. In this situation a
<p>
The second situation is much less serious than the first because APT places
-certain assurances on the order that packages are installed. In both cases
-supplying the <tt>-f</> option to <prgn>atp-get</> will cause APT to deduce a
+certain constraints on the order that packages are installed. In both cases
+supplying the <tt>-f</> option to <prgn>apt-get</> will cause APT to deduce a
possible solution to the problem and then continue on. The APT <prgn>dselect</>
method always supplies the <tt>-f</> option to allow for easy continuation
of failed maintainer scripts.
be taken off. The <tt>-f</> option is especially good at generating packages
to remove so extreme care should be used in that case. The list may contain
packages that are going to be removed because they are only
-partially removed, possibly due to an aborted installation.
+partially installed, possibly due to an aborted installation.
</sect1>
<sect1>The New Packages list
removed then the value may indicate the amount of space that will be
freed.
+<p>
+Some other reports can be generated by using the -u option to show packages
+to upgrade, they are similar to the previous examples.
</sect>
<!-- ===================================================================== -->
<sect>The Status Display
<p>
During the download of archives and package files APT prints out a series of
-status messages,
+status messages.
<p>
<example>
# apt-get update
-Get http://ftp.de.debian.org/debian-non-US/ stable/binary-i386/ Packages
-Get http://llug.sep.bnl.gov/debian/ frozen/contrib Packages
-Get http://llug.sep.bnl.gov/debian/ frozen/main Packages
-Get http://ftp.de.debian.org/debian-non-US/ unstable/binary-i386/ Packages
-Get http://llug.sep.bnl.gov/debian/ frozen/non-free Packages
-11% [Packages `Waiting for file' 0/32.1k 0%] 2203b/s 1m52s
+Get:1 http://ftp.de.debian.org/debian-non-US/ stable/non-US/ Packages
+Get:2 http://llug.sep.bnl.gov/debian/ testing/contrib Packages
+Hit http://llug.sep.bnl.gov/debian/ testing/main Packages
+Get:4 http://ftp.de.debian.org/debian-non-US/ unstable/binary-i386/ Packages
+Get:5 http://llug.sep.bnl.gov/debian/ testing/non-free Packages
+11% [5 testing/non-free `Waiting for file' 0/32.1k 0%] 2203b/s 1m52s
</example>
<p>
inaccuracies.
<p>
-The next section of the status line is repeated once for each dowload thread
-and indicates the operation being performed and some usefull information
+The next section of the status line is repeated once for each download thread
+and indicates the operation being performed and some useful information
about what is happening. Sometimes this section will simply read <em>Forking</>
-which means the OS is loading the download module. The first word after the [
+which means the OS is loading the download module. The first word after the [
+is the fetch number as shown on the history lines. The next word
is the short form name of the object being downloaded. For archives it will
contain the name of the package that is being fetched.
of the negotiation phase of the download. Typically it progresses from
<em>Connecting</> to <em>Waiting for file</> to <em>Downloading</> or
<em>Resuming</>. The final value is the number of bytes downloaded from the
-remote site. Once the download beings this is represented as <tt>102/10.2k</>
+remote site. Once the download begins this is represented as <tt>102/10.2k</>
indicating that 102 bytes have been fetched and 10.2 kilobytes is expected.
The total size is always shown in 4 figure notation to preserve space. After
the size display is a percent meter for the file itself.
-The second last element is the instantenous average speed. This values is
+The second last element is the instantaneous average speed. This values is
updated every 5 seconds and reflects the rate of data transfer for that
period. Finally is shown the estimated transfer time. This is updated
regularly and reflects the time to complete everything at the shown
<p>
APT uses <prgn>dpkg</> for installing the archives and will switch
over to the <prgn>dpkg</> interface once downloading is completed.
-<prgn>dpkg</> will also as a number of questions as it processes the packages
+<prgn>dpkg</> will also ask a number of questions as it processes the packages
and the packages themselves may also ask several questions. Before each
question there is usually a description of what it is asking and the
questions are too varied to discuss completely here.