Читаем The Debian Administrator's Handbook полностью

 trying to overwrite "/usr/lib/libisc.so.50", which is also in package libisc50 1:9.6.1.dfsg.P1-3

In this case, if you think that replacing this file is not a significant risk to the stability of your system (which is usually the case), you can use the option --force-overwrite, which tells dpkg to ignore this error and overwrite the file.

While there are many available --force-* options, only --force-overwrite is likely to be used regularly. These options only exist for exceptional situations, and it is better to leave them alone as much as possible in order to respect the rules imposed by the packaging mechanism. Do not forget, these rules ensure the consistency and stability of your system.

CAUTION Effective use of --force-*

If you are not careful, the use of an option --force-* can lead to a system where the APT family of commands will refuse to function. In effect, some of these options allow installation of a package when a dependency is not met, or when there is a conflict. The result is an inconsistent system from the point of view of dependencies, and the APT commands will refuse to execute any action unless the action enables it to return the system to a consistent state (this often consists of installing the missing dependency or removing a problematic package). This often results in a message like this one, obtained after installing a new version of rdesktop while ignoring its dependency on a newer version of the libc6:

# apt-get dist-upgrade

[...]

You can run "apt-get -f install" to correct these problems.

The following packages contain unmet dependencies:

  rdesktop: Depends on: libc6 (>= 2.5) but 2.3.6.ds1-13etch7 is installed

E: missing dependencies. Try to use the option -f.

A courageous administrator who is certain of the correctness of their analysis may choose to ignore a dependency or conflict and use the corresponding --force-* option. In this case, if they want to be able to continue to use apt-get or aptitude, they must edit /var/lib/dpkg/status to delete/modify the dependency, or conflict, that they chose to override.

This manipulation is an ugly hack, and should never be used, except in the most extreme case of necessity. Quite frequently, a more fitting solution is to recompile the package that's causing the problem (see Section 15.1, “Rebuilding a Package from its Sources”) or use a new version (potentially corrected) from a site such as backports.debian.org (see Section 6.1.1.2, “The Backports From backports.debian.org”).

5.4.2. Package Removal

Invoking dpkg with the -r or --remove option, followed by the name of a package, removes that package. This removal is, however, not complete: all of the configuration files and scripts, log files (system logs) and other user data handled by the package remain. The reason for keeping them is to disable the program by uninstalling it, while preserving the option to reinstall it quickly and with the same configurations. To completely remove everything associated with a package, use the -P or --purge option, followed by the package name.

Example 5.4. Removal and purge of the debian-cd package

dpkg -r debian-cd

(Reading database... 14170 files and directories already installed.)

Removing debian-cd ...

dpkg -P debian-cd

(Reading database... 13794 files and directories already installed.)

Removing debian-cd ...

Removing debian-cd configuration files...

5.4.3. Other dpkg Features

BACK TO BASICS Option syntax

Most options are available in the “long” version (one or more relevant words, preceded by a double dash) or a “short” version (a single letter, often the initial of one word from the long version, and preceded by a single dash). This convention is so common that it is a POSIX standard.

Before concluding this section, we note that some dpkg options may query the internal database in order to obtain information. Giving first the long options and then corresponding short options (that will evidently take the same possible arguments) we cite --listfiles package (or -L), which lists the files installed by this package; --search file (or -S), which finds the package from which the file comes; --status package (or -s), which displays the headers of an installed package; --list (or -l), which displays the list of packages known to the system and their installation status; --contents file.deb (or -c), which lists the files in the Debian package specified; --info file.deb (or -I), which displays the headers of the Debian package.

Example 5.5. Various queries with dpkg

dpkg -L base-passwd

/.

/usr

/usr/sbin

/usr/sbin/update-passwd

/usr/share

/usr/share/man

/usr/share/man/ru

/usr/share/man/ru/man8

/usr/share/man/ru/man8/update-passwd.8.gz

/usr/share/man/pl

/usr/share/man/pl/man8

Перейти на страницу:

Похожие книги