dpkg.8 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562
  1. .\" Hey Emacs! This file is -*- nroff -*- source.
  2. .TH DPKG 8 "April 12, 1998" "Debian Project" "Debian GNU/Linux"
  3. .SH NAME
  4. dpkg \- a medium-level package manager for Debian GNU/Linux
  5. .SH SYNOPSIS
  6. .B dpkg
  7. [\fIoptions\fP] \fIaction\fP
  8. .SH WARNING
  9. This manual is intended for users wishing to understand \fBdpkg\fP's
  10. command line options and package states in more detail than that
  11. provided by \fBdpkg --help\fP.
  12. It should \fInot\fP be used by package maintainers wishing to
  13. understand how \fBdpkg\fP will install their packages. The
  14. descriptions of what \fBdpkg\fP does when installing and removing
  15. packages are particularly inadequate. For detailed information about
  16. this, please refer to the \fIPackage Management System\fP topic under
  17. \fIdebian-faq\fP in the GNU Info system. For information about
  18. creating Debian packages, see the \fIDebian Package Management
  19. Tools\fP topic in the same place.
  20. .SH DESCRIPTION
  21. \fBdpkg\fP is a medium-level tool to install, build, remove and manage
  22. Debian GNU/Linux packages. The primary and more user-friendly
  23. front-end for \fBdpkg\fP is \fBdselect\fP(8). \fBdpkg\fP itself is
  24. controlled entirely via command line parameters, which consist of exactly
  25. one action and zero or more options. The action-parameter tells dpkg
  26. what to do and options control the behavior of the action in some way.
  27. \fBdpkg\fP can be also be used as a front-end to \fBdpkg-deb\fP.
  28. The following
  29. are \fBdpkg-deb\fP actions, and if they are encountered, \fBdpkg\fP
  30. just runs \fBdpkg-deb\fP with the parameters given to it:
  31. .nf
  32. \fB-b\fP, \fB--build\fP,
  33. \fB-c\fP, \fB--contents\fP,
  34. \fB-I\fP, \fB--info\fP,
  35. \fB-f\fP, \fB--field\fP,
  36. \fB-e\fP, \fB--control\fP,
  37. \fB-x\fP, \fB--extract\fP,
  38. \fB-X\fP, \fB--vextract\fP, and
  39. \fB--fsys-tarfile\fP.
  40. .fi
  41. Please refer to \fBdpkg-deb\fP(1) for information about these actions.
  42. .SH INFORMATION ABOUT PACKAGES
  43. \fBdpkg\fP maintains some usable information about available
  44. packages. The information is divided in three classes: \fBstates\fP,
  45. \fBselection states\fP and \fBflags\fP. These values are intended to
  46. be changed mainly with \fBdselect\fP.
  47. .SS PACKAGE STATES
  48. .TP
  49. .B installed
  50. The package is unpacked and configured OK.
  51. .TP
  52. .B half-installed
  53. The installation of the package has been started, but not completed for
  54. some reason.
  55. .TP
  56. .B not-installed
  57. The package is not installed on your system.
  58. .TP
  59. .B unpacked
  60. The package is unpacked, but not configured.
  61. .TP
  62. .B half-configured
  63. The package is unpacked and configuration has been started, but not yet
  64. completed for some reason.
  65. .TP
  66. .B config-files
  67. Only the configuration files of the package exist on the system.
  68. .SS PACKAGE SELECTION STATES
  69. .TP
  70. .B install
  71. The package is selected for installation.
  72. .TP
  73. .B deinstall
  74. The package is selected for deinstallation (i.e. we want to remove all
  75. files, except configuration files).
  76. .TP
  77. .B purge
  78. The package is selected to be purged (i.e. we want to remove everything,
  79. even configuration files).
  80. .SS PACKAGE FLAGS
  81. .TP
  82. .B hold
  83. A package marked to be on \fBhold\fP is not handled by \fBdpkg\fP,
  84. unless forced to do that with option \fB--force-hold\fP.
  85. .TP
  86. .B reinst-required
  87. A package marked \fBreinst-required\fP is broken and requires
  88. reinstallation. These packages cannot be removed, unless forced with
  89. option \fB--force-reinstreq\fP.
  90. .SH ACTIONS
  91. .TP
  92. \fBdpkg -i\fP | \fB--install\fP \fIpackage_file\fP...
  93. Install the package. If \fB--recursive\fP or \fB-R\fP option is
  94. specified, \fIpackage_file\fP must refer to a directory instead.
  95. Installation consists of the following steps:
  96. .br
  97. \fB1.\fP Extract the control files of the new package.
  98. .br
  99. \fB2.\fP If another version of the same package was installed before
  100. the new installation, execute \fIprerm\fP script of the old package.
  101. .br
  102. \fB3.\fP Run \fIpreinst\fP script, if provided by the package.
  103. .br
  104. \fB4.\fP Unpack the new files, and at the same time back up the old
  105. files, so that if something goes wrong, they can be restored.
  106. .br
  107. \fB5.\fP If another version of the same package was installed before
  108. the new installation, execute the \fIpostrm\fP script of the old
  109. package. Note that this script is executed after the \fIpreinst\fP
  110. script of the new package, because new files are written at the same
  111. time old files are removed.
  112. .br
  113. \fB6.\fP Configure the package. See \fB--configure\fP for detailed
  114. information about how this is done.
  115. .TP
  116. \fBdpkg --unpack \fP\fIpackage_file\fP ...
  117. Unpack the package, but don't configure it. If \fB--recursive\fP or
  118. \fB-R\fP option is specified, \fIpackage_file\fP must refer to a
  119. directory instead.
  120. .TP
  121. \fBdpkg --configure \fP\fIpackage\fP ... | \fB-a\fP | \fB--pending\fP
  122. Reconfigure an unpacked package. If \fB-a\fP or \fB--pending\fP is
  123. given instead of \fIpackage\fP, all unpacked but unconfigured
  124. packages are configured.
  125. Configuring consists of the following steps:
  126. .br
  127. \fB1.\fP Unpack the configuration files, and at the same time back up
  128. the old configuration files, so that they can be restored if
  129. something goes wrong.
  130. .br
  131. \fB2.\fP Run \fIpostinst\fP script, if provided by the package.
  132. .TP
  133. \fBdpkg -r\fP | \fB--remove\fP | \fB-P\fP | \fB--purge \fP\fIpackage\fP ... | \fB-a\fP | \fB--pending\fP
  134. Remove an installed package. \fB-r\fP or \fB--remove\fP remove
  135. everything except configuration files. This may avoid having to
  136. reconfigure the package if it is reinstalled later. (Configuration
  137. files are the files listed in the \fIdebian/conffiles\fP control
  138. file). \fB-P\fP or \fB--purge\fP removes everything, including configuration
  139. files. If \fB-a\fP or \fB--pending\fP is given instead of a package
  140. name, then all packages unpacked, but marked to be removed or purged
  141. in file \fI/var/lib/dpkg/status\fP, are removed or purged,
  142. respectively.
  143. Removing of a package consists of the following steps:
  144. .br
  145. \fB1.\fP Run \fIprerm\fP script
  146. .br
  147. \fB2.\fP Remove the installed files
  148. .br
  149. \fB3.\fP Run \fIpostrm\fP script
  150. .br
  151. .TP
  152. .BI "dpkg -p|--print-avail " package
  153. Display details about \fIpackage\fP, as found in
  154. \fI/var/lib/dpkg/available\fP.
  155. .TP
  156. \fBdpkg --update-avail\fP | \fB--merge-avail\fP \fIPackages-file\fP
  157. Update \fBdpkg\fP's and \fBdselect\fP's idea of which packages are
  158. available. With action \fB--merge-avail\fP, old information is
  159. combined with information from \fIPackages-file\fP. With action
  160. \fB--update-avail\fP, old information is replaced with the information
  161. in the \fIPackages-file\fP. The \fIPackages-file\fP distributed with
  162. Debian GNU/Linux is simply named \fIPackages\fP. \fBdpkg\fP keeps its
  163. record of available packages in \fI/var/lib/dpkg/available\fP.
  164. .TP
  165. \fBdpkg -A\fP | \fB--record-avail\fP \fIpackage_file\fP ...
  166. Update \fBdpkg\fP and \fBdselect\fP's idea of which packages are
  167. available with information from the package \fIpackage_file\fP. If
  168. \fB--recursive\fP or \fB-R\fP option is specified, \fIpackage_file\fP
  169. must refer to a directory instead.
  170. .TP
  171. .B dpkg --forget-old-unavail
  172. Forget about uninstalled unavailable packages.
  173. .TP
  174. .B dpkg --clear-avail
  175. Erase the existing information about what packages are available.
  176. .TP
  177. \fBdpkg -l\fP | \fB--list\fP \fIpackage-name-pattern\fP ...
  178. List packages matching given pattern. If no \fIpackage-name-pattern\fP
  179. is given, list all packages in \fI/var/lib/dpkg/available\fP. Normal
  180. shell wildchars are allowed in \fIpackage-name-pattern\fP. (You will
  181. probably have to quote \fIpackage-name-pattern\fP to prevent the shell
  182. from performing filename expansion. For example, \fBdpkg -l 'libc5*'\fP will list all the package names starting with "libc5".)
  183. .TP
  184. \fBdpkg -s\fP | \fB--status\fP \fIpackage-name\fP ...
  185. Report status of specified package. This just displays the entry in
  186. the installed package status database.
  187. .TP
  188. \fBdpkg -C\fP | \fB--audit\fP
  189. Searches for packages that have been installed only partially on your
  190. system. \fBdpkg\fP will suggest what to do with them to get them
  191. working.
  192. .TP
  193. \fBdpkg --get-selections\fP [\fIpattern\fP...]
  194. Get list of package selections, and write it to stdout.
  195. .TP
  196. .B dpkg --set-selections
  197. Set package selections using file read from stdin.
  198. .TP
  199. .B dpkg --yet-to-unpack
  200. Searches for packages selected for installation, but which for some
  201. reason still haven't been installed.
  202. .TP
  203. \fBdpkg -L\fP | \fB--listfiles\fP \fIpackage\fP ...
  204. List files installed to your system from \fBpackage\fP.
  205. However, note that files created by package-specific
  206. installation-scripts are not listed.
  207. .TP
  208. \fBdpkg -S\fP | \fB--search\fP \fIfilename-search-pattern\fP ...
  209. Search for a filename from installed packages. All standard shell
  210. wildchars can be used in the pattern.
  211. .TP
  212. .B dpkg --print-architecture
  213. Print target architecture (for example, "i386"). This option uses
  214. \fBgcc\fP.
  215. .TP
  216. .B dpkg --print-gnu-build-architecture
  217. Print GNU version of target architecture (for example, "i486").
  218. .TP
  219. .B dpkg --print-installation-architecture
  220. Print host architecture for installation.
  221. .TP
  222. .B dpkg --compare-versions \fIver1 op ver2\fP
  223. Compare version numbers, where \fIop\fP is a binary operator. \fBdpkg\fP
  224. returns success (zero result) if the specified condition is satisfied,
  225. and failure (nonzero result) otherwise. There are
  226. two groups of operators, which differ in how they treat a missing
  227. \fIver1\fP or \fIver2\fP. These treat no version as earlier than any
  228. version: \fBlt le eq ne ge gt\fP. These treat no version as later
  229. than any version: \fBlt-nl le-nl ge-nl gt-nl\fP. These are provided
  230. only for compatibility with control file syntax: \fB< << <= = >= >>
  231. >\fP.
  232. .TP
  233. .B dpkg --help
  234. Display a brief help message.
  235. .TP
  236. .B dpkg --force-help
  237. Give help about the \fB--force-\fP\fIthing\fP options.
  238. .TP
  239. .BR "dpkg -Dh " | " --debug=help"
  240. Give help about debugging options.
  241. .TP
  242. \fBdpkg --licence\fP | \fBdpkg --license\fP
  243. Display \fBdpkg\fP licence.
  244. .TP
  245. \fBdpkg --version\fP
  246. Display \fBdpkg\fP version information.
  247. .TP
  248. \fBdpkg-deb-actions\fP
  249. See \fBdpkg-deb\fP(1) for more information about the following actions.
  250. .nf
  251. \fBdpkg -b\fP | \fB--build\fP \fIdirectory\fP [\fIfilename\fP]
  252. Build a Debian GNU/Linux package.
  253. \fBdpkg -c\fP | \fB--contents\fP \fIfilename\fP
  254. List contents of Debian GNU/Linux package.
  255. \fBdpkg -e\fP | \fB--control\fP \fIfilename\fP [\fIdirectory\fP]
  256. Extract control-information from a package.
  257. \fBdpkg -x\fP | \fB--extract\fP \fIfilename directory\fP
  258. Extract the files contained by package.
  259. \fBdpkg -f\fP | \fB--field\fP \fIfilename\fP [\fIcontrol-field\fP] ...
  260. Display control field(s) of a package.
  261. \fBdpkg --fsys-tarfile\fP \fIfilename\fP
  262. Display the filesystem tar-file contained by a
  263. Debian package.
  264. \fBdpkg -I\fP | \fB--info\fP \fIfilename\fP [\fIcontrol-file\fP]
  265. Show information about a package.
  266. \fBdpkg -X\fP | \fB--vextract\fP \fIfilename\fP \fIdirectory\fP
  267. Extract and display the filenames contained by a
  268. package.
  269. .fi
  270. .SH OPTIONS
  271. .br
  272. .TP
  273. \fB--abort-after=\fP\fInumber\fP
  274. Change after how many errors dpkg will abort. The default is 50.
  275. .TP
  276. .BR -B | --auto-deconfigure
  277. When a package is removed, there is a possibility that another
  278. installed package depended on the removed package. Specifying this
  279. option will cause automatic deconfiguration of the package which
  280. depended on the removed package.
  281. .TP
  282. \fB-D\fIoctal\fP | \fB--debug=\fP\fIoctal\fP
  283. Set debugging on. \fIoctal\fP is formed by bitwise-orring desired
  284. values together from the list below (note that these values may change
  285. in future releases). \fB-Dh\fP or \fB--debug=help\fP display these
  286. debugging values.
  287. number description
  288. 1 Generally helpful progress information
  289. 2 Invocation and status of maintainer scripts
  290. 10 Output for each file processed
  291. 100 Lots of output for each file processed
  292. 20 Output for each configuration file
  293. 200 Lots of output for each configuration file
  294. 40 Dependencies and conflicts
  295. 400 Lots of dependencies/conflicts output
  296. 1000 Lots of drivel about e.g. the dpkg/info dir
  297. 2000 Insane amounts of drivel
  298. .TP
  299. \fB--force-\fP\fIthings\fP | \fB--no-force-\fP\fIthings\fP | \fB--refuse-\fP\fIthings\fP
  300. Force or refuse (\fBno-force\fP and \fBrefuse\fP mean the same thing)
  301. to do some things. \fIthings\fP is a comma separated list of things
  302. specified below. \fB--force-help\fP displays a message describing them.
  303. Things marked with (*) are forced by default.
  304. \fIWarning: These options are mostly intended to be used by experts
  305. only. Using them without fully understanding their effects may break
  306. your whole system.\fP
  307. \fBall\fP:
  308. Turns on(or off) all force options.
  309. \fBauto-select\fP(*):
  310. Select packages to install them, and deselect packages to remove them.
  311. \fBdowngrade\fP(*):
  312. Install a package, even if newer version of it is already installed.
  313. \fBconfigure-any\fP:
  314. Configure also any unpacked but unconfigured packages on which the current
  315. package depends.
  316. \fBhold\fP:
  317. Process packages even when marked "hold".
  318. \fBremove-reinstreq\fP:
  319. Remove a package, even if it's broken and marked to require
  320. reinstallation. This may, for example, cause parts of the package to
  321. remain on the system, which will then be forgotten by \fBdpkg\fP.
  322. \fBremove-essential\fP:
  323. Remove, even if the package is considered essential. Essential
  324. packages contain mostly very basic Unix commands. Removing them might
  325. cause the whole system to stop working, so use with caution.
  326. \fBdepends\fP:
  327. Turn all dependency problems into warnings.
  328. \fBdepends-version\fP:
  329. Don't care about versions when checking dependencies.
  330. \fBconflicts\fP:
  331. Install, even if it conflicts with another package. This is dangerous,
  332. for it will usually cause overwriting of some files.
  333. \fBconfnew\fP:
  334. If a conffile has been modified always install the new version without
  335. prompting.
  336. \fBconfold\fP:
  337. If a conffile has been modified always keep the old version without prompting.
  338. \fBconfdef\fP:
  339. If a conffile has been modified always choose the default action. If
  340. \fB--force-confnew\fP or \fB--force-confold\fP have also been given
  341. always default. If there is no default then we use the old or new
  342. version, depending on the option given.
  343. \fBoverwrite\fP(*):
  344. Overwrite one package's file with another's file.
  345. \fBoverwrite-dir\fP
  346. Overwrite one package's directory with another's file.
  347. \fBoverwrite-diverted\fP:
  348. Overwrite a diverted file with an undiverted version.
  349. \fBarchitecture\fP:
  350. Process even packages with the wrong architecture.
  351. \fBbad-path\fP:
  352. \fBPATH\fP is missing important programs, so problems are likely.
  353. \fBnot-root\fP:
  354. Try to (de)install things even when not root.
  355. .TP
  356. \fB--ignore-depends\fP=\fIpackage\fP,...
  357. Ignore dependency-checking for specified packages (actually, checking is
  358. performed, but only warnings about conflicts are given, nothing else).
  359. .TP
  360. \fB--largemem\fP | \fB--smallmem\fP
  361. Tells \fBdpkg\fP whether to preserve memory (e.g. with less than 24 MB
  362. of RAM) or consume as much as needed(the default).
  363. .TP
  364. \fB--new\fP | \fB--old\fP
  365. Select new or old binary package format. This is a \fBdpkg-deb\fP(1)
  366. option.
  367. .TP
  368. .B --nocheck
  369. Don't read or check contents of control file while building a package.
  370. This is a \fBdpkg-deb\fP(1) option.
  371. .TP
  372. .B --no-act
  373. Do everything which is supposed to be done, but don't write any
  374. changes. This is used to see what would happen with the specified
  375. action, without actually modifying anything.
  376. Be sure to give \fB--no-act\fP before the action-parameter, or you might
  377. end up with undesirable results. (e.g. \fBdpkg --purge foo
  378. --no-act\fP will first purge package foo and then try to purge package
  379. --no-act, even though you probably expected it to actually do nothing)
  380. .TP
  381. \fB-R\fP | \fB--recursive\fP
  382. Recursively handle all regular files matching pattern \fB*.deb\fP
  383. found at specified directories and all of its subdirectories. This can
  384. be used with \fB-i\fP, \fB-A\fP, \fB--install\fP, \fB--unpack\fP and
  385. \fB--avail\fP actions.
  386. .TP
  387. \fB-G\fP
  388. Don't install a package if a newer version of the same package is already
  389. installed. This is an alias of \fB--refuse-downgrade.\fP
  390. .TP
  391. \fB--root=\fP\fIdir\fP | \fB--admindir=\fP\fIdir\fP | \fB--instdir=\fP\fIdir\fP
  392. Change default directories. \fBadmindir\fP defaults to
  393. \fI/var/lib/dpkg\fP and contains many files that give information
  394. about status of installed or uninstalled packages, etc. \fBinstdir\fP
  395. defaults to \fI/\fP and refers to the directory where packages are to
  396. be installed. \fBinstdir\fP is also the directory passed to
  397. \fBchroot\fP(2) before running \fIpackage\fP's installation scripts, which
  398. means that the scripts see \fBinstdir\fP as a root directory.
  399. Changing \fBroot\fP changes \fBinstdir\fP to \fIdir\fP and
  400. \fBadmindir\fP to \fIdir\fP\fB/var/lib/dpkg\fP.
  401. .TP
  402. \fB-O\fP | \fB--selected-only\fP
  403. Only process the packages that are selected for installation. The
  404. actual marking is done with \fBdselect\fP or by \fBdpkg\fP, when it
  405. handles packages. For example, when a package is removed, it will
  406. be marked selected for installation.
  407. .TP
  408. .BR -E " | " --skip-same-version
  409. Don't install the package if the same version of the package is already
  410. installed.
  411. .SH FILES
  412. The files listed here are in their default directories, see option
  413. \fB--admindir\fP to see how to change locations of these files.
  414. .TP
  415. .I /var/lib/dpkg/available
  416. List of available packages.
  417. .TP
  418. .I /var/lib/dpkg/status
  419. Statuses of available packages. This file contains information about
  420. whether a package is marked for removing or not, whether it is
  421. installed or not, etc. See section \fBINFORMATION ABOUT PACKAGES\fP
  422. for more info.
  423. .P
  424. The following files are components of a binary package. See \fBdeb\fP(5)
  425. for more information about them:
  426. .TP
  427. .I control
  428. .TP
  429. .I conffiles
  430. .TP
  431. .I preinst
  432. .TP
  433. .I postinst
  434. .TP
  435. .I prerm
  436. .TP
  437. .I postrm
  438. .SH ENVIRONMENT VARIABLES
  439. .TP
  440. .B DPKG_NO_TSTP
  441. Define this to something if you prefer \fBdpkg\fP starting a new
  442. shell rather than suspending \fBdpkg\fP, while doing a shell escape.
  443. .TP
  444. .B SHELL
  445. The program \fBdpkg\fP will execute while starting a new shell.
  446. .B COLUMNS
  447. Sets the number of columns \fBdpkg\fP should use when displaying formatted
  448. text. Currently only used by -l.
  449. .SH EXAMPLES
  450. To list packages related to the editor vi:
  451. .br
  452. \fB dpkg -l '*vi*'\fP
  453. .br
  454. To see the entries in \fI/var/lib/dpkg/available\fP on two packages:
  455. .br
  456. \fB dpkg --print-avail elvis vim | less\fP
  457. .br
  458. To search the listing of packages yourself:
  459. .br
  460. \fB less /var/lib/dpkg/available\fP
  461. .br
  462. To remove an installed elvis package:
  463. .br
  464. \fB dpkg -r elvis\fP
  465. .br
  466. To install a package, you first need to find it in an archive or
  467. CDROM. The "available" file shows that the vim package is in section
  468. "editors":
  469. .br
  470. \fB cd /cdrom/hamm/hamm/binary/editors\fP
  471. \fB dpkg -i vim_4.5-3.deb\fP
  472. .br
  473. To make a local copy of the package selection states:
  474. .br
  475. \fB dpkg --get-selections >myselections\fP
  476. .br
  477. You might transfer this file to another computer, and install it there
  478. with:
  479. .br
  480. \fB dpkg --set-selections <myselections\fP
  481. .br
  482. Note that this will not actually install or remove anything, but just
  483. set tghe selection state on the requested packages. You will need some
  484. other application to actually download and install the requested
  485. packages.
  486. Ordinarily, you will find that \fBdselect\fP(8) provides a more
  487. convenient way to modify the package selection states.
  488. .br
  489. .SH SEE ALSO
  490. \fBdselect\fP(8),
  491. \fBdpkg-deb\fP(1),
  492. \fBdeb\fP(5),
  493. and
  494. \fBdeb-control\fP(5)
  495. .SH BUGS
  496. \fB--no-act\fP usually gives less information than might be helpful.
  497. .SH AUTHORS
  498. .nf
  499. See \fB/usr/share/doc/dpkg/THANKS\fP for the list of people who have
  500. contributed to \fBdpkg\fP .
  501. .fi