Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
dpkg(8)
Edit
PageHistory
Diff
Info
LikePages
DPKG !!!DPKG NAME SYNOPSIS WARNING DESCRIPTION INFORMATION ABOUT PACKAGES ACTIONS OPTIONS FILES ENVIRONMENT VARIABLES EXAMPLES SEE ALSO BUGS AUTHORS ---- !!NAME dpkg - a medium-level package manager for Debian !!SYNOPSIS __dpkg__ [[''options''] ''action'' !!WARNING This manual is intended for users wishing to understand __dpkg__'s command line options and package states in more detail than that provided by __dpkg --help__. It should ''not'' be used by package maintainers wishing to understand how __dpkg__ will install their packages. The descriptions of what __dpkg__ does when installing and removing packages are particularly inadequate. For detailed information about this, please refer to the ''Package Management System'' topic under ''debian-faq'' in the GNU Info system. For information about creating Debian packages, see the ''Debian Package Management Tools'' topic in the same place. !!DESCRIPTION __dpkg__ is a medium-level tool to install, build, remove and manage Debian GNU/Linux packages. The primary and more user-friendly front-end for __dpkg__ is dselect(8). __dpkg__ itself is controlled entirely via command line parameters, which consist of exactly one action and zero or more options. The action-parameter tells dpkg what to do and options control the behavior of the action in some way. __dpkg__ can be also be used as a front-end to __dpkg-deb__. The following are __dpkg-deb__ actions, and if they are encountered, __dpkg__ just runs __dpkg-deb__ with the parameters given to it: __ -b__, __--build__, __ -c__, __--contents__, __ -I__, __--info__, __ -f__, __--field__, __ -e__, __--control__, __ -x__, __--extract__, __ -X__, __--vextract__, and __ --fsys-tarfile__. Please refer to dpkg-deb(1) for information about these actions. !!INFORMATION ABOUT PACKAGES __dpkg__ maintains some usable information about available packages. The information is divided in three classes: __states__, __selection states__ and __flags__. These values are intended to be changed mainly with __dselect__. __PACKAGE STATES__ __installed__ The package is unpacked and configured OK. __half-installed__ The installation of the package has been started, but not completed for some reason. __not-installed__ The package is not installed on your system. __unpacked__ The package is unpacked, but not configured. __half-configured__ The package is unpacked and configuration has been started, but not yet completed for some reason. __config-files__ Only the configuration files of the package exist on the system. __PACKAGE SELECTION STATES__ __install__ The package is selected for installation. __deinstall__ The package is selected for deinstallation (i.e. we want to remove all files, except configuration files). __purge__ The package is selected to be purged (i.e. we want to remove everything, even configuration files). __PACKAGE FLAGS__ __hold__ A package marked to be on __hold__ is not handled by __dpkg__, unless forced to do that with option __--force-hold__. __reinst-required__ A package marked __reinst-required__ is broken and requires reinstallation. These packages cannot be removed, unless forced with option __--force-reinstreq__. !!ACTIONS __dpkg -i__ | __--install__ ''package_file''... Install the package. If __--recursive__ or __-R__ option is specified, ''package_file'' must refer to a directory instead. Installation consists of the following steps: __1.__ Extract the control files of the new package. __2.__ If another version of the same package was installed before the new installation, execute ''prerm'' script of the old package. __3.__ Run ''preinst'' script, if provided by the package. __4.__ Unpack the new files, and at the same time back up the old files, so that if something goes wrong, they can be restored. __5.__ If another version of the same package was installed before the new installation, execute the ''postrm'' script of the old package. Note that this script is executed after the ''preinst'' script of the new package, because new files are written at the same time old files are removed. __6.__ Configure the package. See __--configure__ for detailed information about how this is done. __dpkg --unpack__ ''package_file'' ... Unpack the package, but don't configure it. If __--recursive__ or __-R__ option is specified, ''package_file'' must refer to a directory instead. __dpkg --configure__ ''package'' ... | __-a__ | __--pending__ Reconfigure an unpacked package. If __-a__ or __--pending__ is given instead of ''package'', all unpacked but unconfigured packages are configured. Configuring consists of the following steps: __1.__ Unpack the configuration files, and at the same time back up the old configuration files, so that they can be restored if something goes wrong. __2.__ Run ''postinst'' script, if provided by the package. __dpkg -r__ | __--remove__ | __-P__ | __--purge__ ''package'' ... | __-a__ | __--pending__ Remove an installed package. __-r__ or __--remove__ remove everything except configuration files. This may avoid having to reconfigure the package if it is reinstalled later. (Configuration files are the files listed in the ''debian/conffiles'' control file). __-P__ or __--purge__ removes everything, including configuration files. If __-a__ or __--pending__ is given instead of a package name, then all packages unpacked, but marked to be removed or purged in file ''/var/lib/dpkg/status'', are removed or purged, respectively. Removing of a package consists of the following steps: __1.__ Run ''prerm'' script __2.__ Remove the installed files __3.__ Run ''postrm'' script __dpkg -p|--print-avail__ ''package'' Display details about ''package'', as found in ''/var/lib/dpkg/available''. __dpkg --update-avail__ | __--merge-avail__ ''Packages-file'' Update __dpkg__'s and __dselect__'s idea of which packages are available. With action __--merge-avail__, old information is combined with information from ''Packages-file''. With action __--update-avail__, old information is replaced with the information in the ''Packages-file''. The ''Packages-file'' distributed with Debian GNU/Linux is simply named ''Packages''. __dpkg__ keeps its record of available packages in ''/var/lib/dpkg/available''. __dpkg -A__ | __--record-avail__ ''package_file'' ... Update __dpkg__ and __dselect__'s idea of which packages are available with information from the package ''package_file''. If __--recursive__ or __-R__ option is specified, ''package_file'' must refer to a directory instead. __dpkg --forget-old-unavail__ Forget about uninstalled unavailable packages. __dpkg --clear-avail__ Erase the existing information about what packages are available. __dpkg -l__ | __--list__ ''package-name-pattern'' ... List packages matching given pattern. If no ''package-name-pattern'' is given, list all packages in ''/var/lib/dpkg/available''. Normal shell wildchars are allowed in ''package-name-pattern''. (You will probably have to quote ''package-name-pattern'' to prevent the shell from performing filename expansion. For example, __dpkg -l 'libc5*'__ will list all the package names starting with __ __dpkg -s__ | __--status__ ''package-name'' ... Report status of specified package. This just displays the entry in the installed package status database. __dpkg -C__ | __--audit__ Searches for packages that have been installed only partially on your system. __dpkg__ will suggest what to do with them to get them working. __dpkg --get-selections__ [[''pattern''...] Get list of package selections, and write it to stdout. __dpkg --set-selections__ Set package selections using file read from stdin. __dpkg --yet-to-unpack__ Searches for packages selected for installation, but which for some reason still haven't been installed. __dpkg -L__ | __--listfiles__ ''package'' ... List files installed to your system from __package__. However, note that files created by package-specific installation-scripts are not listed. __dpkg -S__ | __--search__ ''filename-search-pattern'' ... Search for a filename from installed packages. All standard shell wildchars can be used in the pattern. __dpkg --print-architecture__ Print target architecture (for example, gcc__. __dpkg --print-gnu-build-architecture__ Print GNU version of target architecture (for example, __dpkg --print-installation-architecture__ Print host architecture for installation. __dpkg --compare-versions__ ''ver1 op ver2'' Compare version numbers, where ''op'' is a binary operator. __dpkg__ returns success (zero result) if the specified condition is satisfied, and failure (nonzero result) otherwise. There are two groups of operators, which differ in how they treat a missing ''ver1'' or ''ver2''. These treat no version as earlier than any version: __lt le eq ne ge gt__. These treat no version as later than any version: __lt-nl le-nl ge-nl gt-nl__. These are provided only for compatibility with control file syntax: __ __. __dpkg --command-fd __ Accept a series of commands on input file descriptor ____. Note: additional options set on the command line, and thru this file descriptor, are not reset for subsequent commands executed during the same run. __dpkg --help__ Display a brief help message. __dpkg --force-help__ Give help about the __--force-__''thing'' options. __dpkg -Dh__ | __--debug=help__ Give help about debugging options. __dpkg --licence__ | __dpkg --license__ Display __dpkg__ licence. __dpkg --version__ Display __dpkg__ version information. __dpkg-deb-actions__ See dpkg-deb(1) for more information about the following actions. __dpkg -b__ | __--build__ ''directory'' [[''filename''] Build a Debian GNU/Linux package. __dpkg -c__ | __--contents__ ''filename '' List contents of Debian GNU/Linux package. __dpkg -e__ | __--control__ ''filename'' [[''directory''] Extract control-information from a package. __dpkg -x__ | __--extract__ ''filename directory '' Extract the files contained by package. __dpkg -f__ | __--field__ '' filename'' [[''control-field''] ... Display control field(s) of a package. __dpkg --fsys-tarfile__ ''filename '' Display the filesystem tar-file contained by a Debian package. __dpkg -I__ | __--info__ ''filename'' [[''control-file''] Show information about a package. __dpkg -X__ | __--vextract__ ''filename directory '' Extract and display the filenames contained by a package. !!OPTIONS All options can be specified both on the commandline and in the __dpkg__ configuration file ''/etc/dpkg/dpkg.cfg''. Each line in the configuration file is either an option (exactly the same as the commandline option but without leading dashes) or a comment (if it starts with a __#__). __--abort-after=__''number'' Change after how many errors dpkg will abort. The default is 50. __-B__|__--auto-deconfigure__ When a package is removed, there is a possibility that another installed package depended on the removed package. Specifying this option will cause automatic deconfiguration of the package which depended on the removed package. __-D__''octal'' __| --debug=__''octal'' Set debugging on. ''octal'' is formed by bitwise-orring desired values together from the list below (note that these values may change in future releases). __-Dh__ or __--debug=help__ display these debugging values. number description 1 Generally helpful progress information 2 Invocation and status of maintainer scripts 10 Output for each file processed 100 Lots of output for each file processed 20 Output for each configuration file 200 Lots of output for each configuration file 40 Dependencies and conflicts 400 Lots of dependencies/conflicts output 1000 Lots of drivel about e.g. the dpkg/info dir 2000 Insane amounts of drivel __--force-__''things'' | __--no-force-__''things'' | __--refuse-__''things'' Force or refuse (__no-force__ and __refuse__ mean the same thing) to do some things. ''things'' is a comma separated list of things specified below. __--force-help__ displays a message describing them. Things marked with (*) are forced by default. ''Warning: These options are mostly intended to be used by experts only. Using them without fully understanding their effects may break your whole system.'' __all__: Turns on(or off) all force options. __auto-select__(*): Select packages to install them, and deselect packages to remove them. __downgrade__(*): Install a package, even if newer version of it is already installed. __configure-any__: Configure also any unpacked but unconfigured packages on which the current package depends. __hold__: Process packages even when marked __ __remove-reinstreq__: Remove a package, even if it's broken and marked to require reinstallation. This may, for example, cause parts of the package to remain on the system, which will then be forgotten by __dpkg__. __remove-essential__: Remove, even if the package is considered essential. Essential packages contain mostly very basic Unix commands. Removing them might cause the whole system to stop working, so use with caution. __depends__: Turn all dependency problems into warnings. __depends-version__: Don't care about versions when checking dependencies. __conflicts__: Install, even if it conflicts with another package. This is dangerous, for it will usually cause overwriting of some files. __confnew__: If a conffile has been modified always install the new version without prompting. __confold__: If a conffile has been modified always keep the old version without prompting. __confdef__: If a conffile has been modified always choose the default action. If there is no default action it will stop to ask the user unless __--force-confnew__ or __--force-confold__ is also been given, in which case it will use that to decide the final action. __overwrite__: Overwrite one package's file with another's file. __overwrite-dir__ Overwrite one package's directory with another's file. __overwrite-diverted__: Overwrite a diverted file with an undiverted version. __architecture__: Process even packages with the wrong architecture. __bad-path__: __PATH__ is missing important programs, so problems are likely. __not-root__: Try to (de)install things even when not root. __--ignore-depends__=''package'',... Ignore dependency-checking for specified packages (actually, checking is performed, but only warnings about conflicts are given, nothing else). __--new__ | __--old__ Select new or old binary package format. This is a dpkg-deb(1) option. __--nocheck__ Don't read or check contents of control file while building a package. This is a dpkg-deb(1) option. __--no-act__ Do everything which is supposed to be done, but don't write any changes. This is used to see what would happen with the specified action, without actually modifying anything. Be sure to give __--no-act__ before the action-parameter, or you might end up with undesirable results. (e.g. __dpkg --purge foo --no-act__ will first purge package foo and then try to purge package --no-act, even though you probably expected it to actually do nothing) __-R__ | __--recursive__ Recursively handle all regular files matching pattern __*.deb__ found at specified directories and all of its subdirectories. This can be used with __-i__, __-A__, __--install__, __--unpack__ and __--avail__ actions. __-G__ Don't install a package if a newer version of the same package is already installed. This is an alias of __--refuse-downgrade.__ __--root=__''dir'' | __--admindir=__''dir'' | __--instdir=__''dir'' Change default directories. __admindir__ defaults to ''/var/lib/dpkg'' and contains many files that give information about status of installed or uninstalled packages, etc. __instdir__ defaults to ''/'' and refers to the directory where packages are to be installed. __instdir__ is also the directory passed to chroot(2) before running ''package'''s installation scripts, which means that the scripts see __instdir__ as a root directory. Changing __root__ changes __instdir__ to ''dir'' and __admindir__ to ''dir''__/var/lib/dpkg__. __-O__ | __--selected-only__ Only process the packages that are selected for installation. The actual marking is done with __dselect__ or by __dpkg__, when it handles packages. For example, when a package is removed, it will be marked selected for installation. __-E__ | __--skip-same-version__ Don't install the package if the same version of the package is already installed. __--status-fd__ '''' Send package status info to file descriptor ''''. This can be given multiple times. Status updates are of the form `status: '' !!FILES ''/etc/dpkg/dpkg.cfg'' Configuration file with default options. The other files listed below are in their default directories, see option __--admindir__ to see how to change locations of these files. ''/var/lib/dpkg/available'' List of available packages. ''/var/lib/dpkg/status'' Statuses of available packages. This file contains information about whether a package is marked for removing or not, whether it is installed or not, etc. See section __INFORMATION ABOUT PACKAGES__ for more info. The following files are components of a binary package. See deb(5) for more information about them: ''control'' ''conffiles'' ''preinst'' ''postinst'' ''prerm'' ''postrm'' !!ENVIRONMENT VARIABLES __DPKG_NO_TSTP__ Define this to something if you prefer __dpkg__ starting a new shell rather than suspending itself, while doing a shell escape. __SHELL__ The program __dpkg__ will execute while starting a new shell. __COLUMNS__ Sets the number of columns __dpkg__ should use when displaying formatted text. Currently only used by -l. !!EXAMPLES To list packages related to the editor vi:__ dpkg -l '*vi*'__ To see the entries in ''/var/lib/dpkg/available'' on two packages:__ dpkg --print-avail elvis vim | less__ To search the listing of packages yourself:__ less /var/lib/dpkg/available__ To remove an installed elvis package:__ dpkg -r elvis__ To install a package, you first need to find it in an archive or CDROM. The cd /cdrom/hamm/hamm/binary/editors dpkg -i vim_4.5-3.deb__ To make a local copy of the package selection states:__ dpkg --get-selections You might transfer this file to another computer, and install it there with:__ dpkg --set-selections Note that this will not actually install or remove anything, but just set the selection state on the requested packages. You will need some other application to actually download and install the requested packages. Ordinarily, you will find that dselect(8) provides a more convenient way to modify the package selection states. !!SEE ALSO dselect(8), dpkg-deb(1), deb(5), and deb-control(5) !!BUGS __--no-act__ usually gives less information than might be helpful. !!AUTHORS See __/usr/share/doc/dpkg/THANKS__ for the list of people who have contributed to __dpkg__ . ----
22 pages link to
dpkg(8)
:
RedHatToDebianNotes
Man8d
dpkg(1)
apt-cache(8)
Debian
deb-control(5)
dpkg-deb(1)
dpkg-name(1)
dpkg-split(8)
apt-get(8)
dh_builddeb(1)
dpkg-divert(8)
dpkg-source(1)
dpkg-statoverride(8)
dselect(8)
tasksel(8)
dpkg-scanpackages(8)
Deb
apt.conf(5)
apt-move(8)
NewUserTips
SSHNotes
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.