Both that APT dselect
method and apt-get
share the
same interface. It is a simple system that generally tells you what it will do
and then goes and does it. [2] After
printing out a summary of what will happen APT then will print out some
informative status messages so that you can estimate how far along it is and
how much is left to do.
Before all operations, except update, APT performs a number of actions to prepare its internal state. It also does some checks of the systems state. At any time these operations can be performed by running apt-get chec
# apt-get check Reading Package Lists... Done Building Dependancy Tree... Done
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.
The final operation performs a detailed analysis of the systems 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
apt-get
will refuse to run.
# apt-get check Reading Package Lists... Done Building Dependancy Tree... Done You might want to run apt-get -f install' to correct these. 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)
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. A short explanation of why the package has a dependency problem is also included.
There are two ways a system can get into a broken state like this. The first
is caused by dpkg missing
some subtle relationships between
packages when performing upgrades. [3]. The second is if a package installation fails during an
operation. In this situation a package may have been unpacked without its
dependents being installed.
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 -f option to atp-get
will cause APT to
deduce a possible solution to the problem and then continue on. The APT
dselect
method always supplies the -f option to allow
for easy continuation of failed maintainer scripts.
However, if the -f option is used to correct a seriously broken system caused by the first case then it is possible that it will either fail immediately or the installation sequence will fail. In either cas