dpkg.1 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786
  1. .TH dpkg 1 "2011-08-14" "Debian Project" "dpkg suite"
  2. .SH NAME
  3. dpkg \- package manager for Debian
  4. .
  5. .SH SYNOPSIS
  6. .B dpkg
  7. .RI [ option "...] " action
  8. .
  9. .SH WARNING
  10. This manual is intended for users wishing to understand \fBdpkg\fP's
  11. command line options and package states in more detail than that
  12. provided by \fBdpkg \-\-help\fP.
  13. It should \fInot\fP be used by package maintainers wishing to
  14. understand how \fBdpkg\fP will install their packages. The
  15. descriptions of what \fBdpkg\fP does when installing and removing
  16. packages are particularly inadequate.
  17. .
  18. .SH DESCRIPTION
  19. \fBdpkg\fP is a tool to install, build, remove and manage
  20. Debian packages. The primary and more user-friendly
  21. front-end for \fBdpkg\fP is \fBaptitude\fP(1). \fBdpkg\fP itself is
  22. controlled entirely via command line parameters, which consist of exactly
  23. one action and zero or more options. The action-parameter tells \fBdpkg\fP
  24. what to do and options control the behavior of the action in some way.
  25. \fBdpkg\fP can also be used as a front-end to \fBdpkg\-deb\fP(1) and
  26. \fBdpkg\-query\fP(1). The list of supported actions can be found later on
  27. in the \fBACTIONS\fP section. If any such action is encountered \fBdpkg\fP
  28. just runs \fBdpkg\-deb\fP or \fBdpkg\-query\fP with the parameters given
  29. to it, but no specific options are currently passed to them, to use
  30. any such option the back-ends need to be called directly.
  31. .
  32. .SH INFORMATION ABOUT PACKAGES
  33. \fBdpkg\fP maintains some usable information about available
  34. packages. The information is divided in three classes: \fBstates\fP,
  35. \fBselection states\fP and \fBflags\fP. These values are intended to
  36. be changed mainly with \fBdselect\fP.
  37. .SS PACKAGE STATES
  38. .TP
  39. .B not\-installed
  40. The package is not installed on your system.
  41. .TP
  42. .B config\-files
  43. Only the configuration files of the package exist on the system.
  44. .TP
  45. .B half\-installed
  46. The installation of the package has been started, but not completed for
  47. some reason.
  48. .TP
  49. .B unpacked
  50. The package is unpacked, but not configured.
  51. .TP
  52. .B half\-configured
  53. The package is unpacked and configuration has been started, but not yet
  54. completed for some reason.
  55. .TP
  56. .B triggers\-awaited
  57. The package awaits trigger processing by another package.
  58. .TP
  59. .B triggers\-pending
  60. The package has been triggered.
  61. .TP
  62. .B installed
  63. The package is unpacked and configured OK.
  64. .SS PACKAGE SELECTION STATES
  65. .TP
  66. .B install
  67. The package is selected for installation.
  68. .TP
  69. .B hold
  70. A package marked to be on \fBhold\fP is not handled by \fBdpkg\fP,
  71. unless forced to do that with option \fB\-\-force\-hold\fP.
  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. from system directories, even configuration files).
  80. .SS PACKAGE FLAGS
  81. .TP
  82. .B reinst\-required
  83. A package marked \fBreinst\-required\fP is broken and requires
  84. reinstallation. These packages cannot be removed, unless forced with
  85. option \fB\-\-force\-remove\-reinstreq\fP.
  86. .
  87. .SH ACTIONS
  88. .TP
  89. \fB\-i\fP, \fB\-\-install\fP \fIpackage-file\fP...
  90. Install the package. If \fB\-\-recursive\fP or \fB\-R\fP option is
  91. specified, \fIpackage-file\fP must refer to a directory instead.
  92. Installation consists of the following steps:
  93. .br
  94. \fB1.\fP Extract the control files of the new package.
  95. .br
  96. \fB2.\fP If another version of the same package was installed before
  97. the new installation, execute \fIprerm\fP script of the old package.
  98. .br
  99. \fB3.\fP Run \fIpreinst\fP script, if provided by the package.
  100. .br
  101. \fB4.\fP Unpack the new files, and at the same time back up the old
  102. files, so that if something goes wrong, they can be restored.
  103. .br
  104. \fB5.\fP If another version of the same package was installed before
  105. the new installation, execute the \fIpostrm\fP script of the old
  106. package. Note that this script is executed after the \fIpreinst\fP
  107. script of the new package, because new files are written at the same
  108. time old files are removed.
  109. .br
  110. \fB6.\fP Configure the package. See \fB\-\-configure\fP for detailed
  111. information about how this is done.
  112. .TP
  113. \fB\-\-unpack \fP\fIpackage-file\fP...
  114. Unpack the package, but don't configure it. If \fB\-\-recursive\fP or
  115. \fB\-R\fP option is specified, \fIpackage-file\fP must refer to a
  116. directory instead.
  117. .TP
  118. \fB\-\-configure \fP\fIpackage\fP...|\fB\-a\fP|\fB\-\-pending\fP
  119. Configure a package which has been unpacked but not yet configured.
  120. If \fB\-a\fP or \fB\-\-pending\fP is given instead of \fIpackage\fP,
  121. all unpacked but unconfigured packages are configured.
  122. To reconfigure a package which has already been configured, try the
  123. .BR dpkg\-reconfigure (8)
  124. command instead.
  125. Configuring consists of the following steps:
  126. .br
  127. \fB1.\fP Unpack the conffiles, and at the same time back up
  128. the old conffiles, 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. \fB\-\-triggers\-only\fP \fIpackage\fP...|\fB\-a\fP|\fB\-\-pending\fP
  134. Processes only triggers. All pending triggers will be processed. If package
  135. names are supplied only those packages' triggers will be processed, exactly
  136. once each where necessary. Use of this option may leave packages in the
  137. improper \fBtriggers\-awaited\fP and \fBtriggers\-pending\fP states. This
  138. can be fixed later by running: \fBdpkg \-\-configure \-\-pending\fP.
  139. .TP
  140. \fB\-r\fP, \fB\-\-remove\fP, \fB\-P\fP, \fB\-\-purge \fP\fIpackage\fP...|\fB\-a\fP|\fB\-\-pending\fP
  141. Remove an installed package. \fB\-r\fP or \fB\-\-remove\fP remove
  142. everything except conffiles. This may avoid having to
  143. reconfigure the package if it is reinstalled later. (Conffiles are configuration
  144. files that are listed in the \fIDEBIAN/conffiles\fP control
  145. file). \fB\-P\fP or \fB\-\-purge\fP removes everything, including
  146. conffiles. If \fB\-a\fP or \fB\-\-pending\fP is given instead of a package
  147. name, then all packages unpacked, but marked to be removed or purged
  148. in file \fI/var/lib/dpkg/status\fP, are removed or purged,
  149. respectively. Note: some configuration files might be unknown to
  150. \fBdpkg\fP because they are created and handled separately through the
  151. configuration scripts. In that case, \fBdpkg\fP won't remove them by
  152. itself, but the package's \fIpostrm\fP script (which is called by
  153. \fBdpkg\fP), has to take care of their removal during purge. Of course,
  154. this only applies to files in system directories, not configuration files
  155. written to individual users' home directories.
  156. Removing of a package consists of the following steps:
  157. .br
  158. \fB1.\fP Run \fIprerm\fP script
  159. .br
  160. \fB2.\fP Remove the installed files
  161. .br
  162. \fB3.\fP Run \fIpostrm\fP script
  163. .br
  164. .TP
  165. \fB\-\-update\-avail\fP, \fB\-\-merge\-avail\fP \fIPackages-file\fP
  166. Update \fBdpkg\fP's and \fBdselect\fP's idea of which packages are
  167. available. With action \fB\-\-merge\-avail\fP, old information is
  168. combined with information from \fIPackages-file\fP. With action
  169. \fB\-\-update\-avail\fP, old information is replaced with the information
  170. in the \fIPackages-file\fP. The \fIPackages-file\fP distributed with
  171. Debian is simply named \fIPackages\fP. \fBdpkg\fP keeps its
  172. record of available packages in \fI/var/lib/dpkg/available\fP.
  173. A simpler one-shot command to retrieve and update the \fIavailable\fR
  174. file is \fBdselect update\fR. Note that this file is mostly useless
  175. if you don't use \fBdselect\fR but an APT-based frontend: APT has its
  176. own system to keep track of available packages.
  177. .TP
  178. \fB\-A\fP, \fB\-\-record\-avail\fP \fIpackage-file\fP...
  179. Update \fBdpkg\fP and \fBdselect\fP's idea of which packages are
  180. available with information from the package \fIpackage-file\fP. If
  181. \fB\-\-recursive\fP or \fB\-R\fP option is specified, \fIpackage-file\fP
  182. must refer to a directory instead.
  183. .TP
  184. .B \-\-forget\-old\-unavail
  185. Now \fBobsolete\fP and a no-op as \fBdpkg\fP will automatically forget
  186. uninstalled unavailable packages.
  187. .TP
  188. .B \-\-clear\-avail
  189. Erase the existing information about what packages are available.
  190. .TP
  191. \fB \-C\fP, \fB\-\-audit\fP
  192. Searches for packages that have been installed only partially on your
  193. system. \fBdpkg\fP will suggest what to do with them to get them
  194. working.
  195. .TP
  196. \fB\-\-get\-selections\fP [\fIpackage-name-pattern\fP...]
  197. Get list of package selections, and write it to stdout. Without a pattern,
  198. non-installed packages (i.e. those which have been previously purged)
  199. will not be shown.
  200. .TP
  201. .B \-\-set\-selections
  202. Set package selections using file read from stdin. This file should be
  203. in the format '\fIpackage\fP \fIstate\fP', where state is one of
  204. \fBinstall\fP, \fBhold\fP, \fBdeinstall\fP or \fBpurge\fP. Blank lines
  205. and comment lines beginning with '#' are also permitted.
  206. .TP
  207. .B \-\-clear\-selections
  208. Set the requested state of every non-essential package to deinstall.
  209. This is intended to be used immediately before \-\-set\-selections, to
  210. deinstall any packages not in list given to \-\-set\-selections.
  211. .TP
  212. .B \-\-yet\-to\-unpack
  213. Searches for packages selected for installation, but which for some
  214. reason still haven't been installed.
  215. .TP
  216. .TP
  217. .B \-\-print\-architecture
  218. Print architecture of packages \fBdpkg\fP installs (for example, "i386").
  219. .TP
  220. .B \-\-compare\-versions \fIver1 op ver2\fP
  221. Compare version numbers, where \fIop\fP is a binary operator. \fBdpkg\fP
  222. returns success (zero result) if the specified condition is satisfied,
  223. and failure (nonzero result) otherwise. There are
  224. two groups of operators, which differ in how they treat an empty
  225. \fIver1\fP or \fIver2\fP. These treat an empty version as earlier than any
  226. version: \fBlt le eq ne ge gt\fP. These treat an empty version as later
  227. than any version: \fBlt\-nl le\-nl ge\-nl gt\-nl\fP. These are provided
  228. only for compatibility with control file syntax: \fB< << <= = >= >>
  229. >\fP.
  230. .TP
  231. .B \-\-command\-fd \fIn\fP
  232. Accept a series of commands on input file descriptor \fIn\fP. Note:
  233. additional options set on the command line, and through this file descriptor,
  234. are not reset for subsequent commands executed during the same run.
  235. .TP
  236. .B \-\-help
  237. Display a brief help message.
  238. .TP
  239. .B \-\-force\-help
  240. Give help about the \fB\-\-force\-\fP\fIthing\fP options.
  241. .TP
  242. .BR \-Dh ", " \-\-debug=help
  243. Give help about debugging options.
  244. .TP
  245. \fB\-\-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. \fB\-b\fP, \fB\-\-build\fP \fIdirectory\fP [\fIarchive\fP|\fIdirectory\fP]
  252. Build a deb package.
  253. \fB\-c\fP, \fB\-\-contents\fP \fIarchive\fP
  254. List contents of a deb package.
  255. \fB\-e\fP, \fB\-\-control\fP \fIfilename\fP [\fIdirectory\fP]
  256. Extract control-information from a package.
  257. \fB\-x\fP, \fB\-\-extract\fP \fIarchive directory\fP
  258. Extract the files contained by package.
  259. \fB\-X\fP, \fB\-\-vextract\fP \fIarchive directory\fP
  260. Extract and display the filenames contained by a
  261. package.
  262. \fB\-f\fP, \fB\-\-field\fP \fIarchive\fP [\fIcontrol-field\fP...]
  263. Display control field(s) of a package.
  264. \fB\-\-fsys\-tarfile\fP \fIarchive\fP
  265. Display the filesystem tar-file contained by a
  266. Debian package.
  267. \fB\-I\fP, \fB\-\-info\fP \fIarchive\fP [\fIcontrol-file\fP...]
  268. Show information about a package.
  269. .fi
  270. .TP
  271. \fBdpkg\-query actions\fP
  272. See \fBdpkg\-query\fP(1) for more information about the following actions.
  273. .nf
  274. \fB\-l\fP, \fB\-\-list\fP \fIpackage-name-pattern\fP...
  275. List packages matching given pattern.
  276. \fB\-s\fP, \fB\-\-status\fP \fIpackage-name\fP...
  277. Report status of specified package.
  278. \fB\-L\fP, \fB\-\-listfiles\fP \fIpackage-name\fP...
  279. List files installed to your system from \fIpackage-name\fP.
  280. \fB\-S\fP, \fB\-\-search\fP \fIfilename-search-pattern\fP...
  281. Search for a filename from installed packages.
  282. \fB\-p\fP, \fB\-\-print\-avail\fP \fIpackage-name\fP...
  283. Display details about \fIpackage-name\fP, as found in
  284. \fI/var/lib/dpkg/available\fP. Users of APT-based frontends
  285. should use \fBapt\-cache show\fP \fIpackage-name\fP instead.
  286. .fi
  287. .
  288. .SH OPTIONS
  289. All options can be specified both on the command line and in the \fBdpkg\fP
  290. configuration file \fI/etc/dpkg/dpkg.cfg\fP or the files on the configuration
  291. directory \fI/etc/dpkg/dpkg.cfg.d/\fP. Each line in the configuration
  292. file is either an option (exactly the same as the command line option but
  293. without leading dashes) or a comment (if it starts with a \fB#\fR).
  294. .br
  295. .TP
  296. \fB\-\-abort\-after=\fP\fInumber\fP
  297. Change after how many errors \fBdpkg\fP will abort. The default is 50.
  298. .TP
  299. .BR \-B ", " \-\-auto\-deconfigure
  300. When a package is removed, there is a possibility that another
  301. installed package depended on the removed package. Specifying this
  302. option will cause automatic deconfiguration of the package which
  303. depended on the removed package.
  304. .TP
  305. \fB\-D\fIoctal\fP, \fB\-\-debug=\fP\fIoctal\fP
  306. Switch debugging on. \fIoctal\fP is formed by bitwise-orring desired
  307. values together from the list below (note that these values may change
  308. in future releases). \fB\-Dh\fP or \fB\-\-debug=help\fP display these
  309. debugging values.
  310. Number Description
  311. 1 Generally helpful progress information
  312. 2 Invocation and status of maintainer scripts
  313. 10 Output for each file processed
  314. 100 Lots of output for each file processed
  315. 20 Output for each configuration file
  316. 200 Lots of output for each configuration file
  317. 40 Dependencies and conflicts
  318. 400 Lots of dependencies/conflicts output
  319. 10000 Trigger activation and processing
  320. 20000 Lots of output regarding triggers
  321. 40000 Silly amounts of output regarding triggers
  322. 1000 Lots of drivel about e.g. the dpkg/info dir
  323. 2000 Insane amounts of drivel
  324. .TP
  325. \fB\-\-force\-\fP\fIthings\fP, \fB\-\-no\-force\-\fP\fIthings\fP, \fB\-\-refuse\-\fP\fIthings\fP
  326. Force or refuse (\fBno\-force\fP and \fBrefuse\fP mean the same thing)
  327. to do some things. \fIthings\fP is a comma separated list of things
  328. specified below. \fB\-\-force\-help\fP displays a message describing them.
  329. Things marked with (*) are forced by default.
  330. \fIWarning: These options are mostly intended to be used by experts
  331. only. Using them without fully understanding their effects may break
  332. your whole system.\fP
  333. \fBall\fP:
  334. Turns on (or off) all force options.
  335. \fBdowngrade\fP(*):
  336. Install a package, even if newer version of it is already installed.
  337. \fIWarning: At present dpkg does not do any dependency
  338. checking on downgrades and therefore will not warn you
  339. if the downgrade breaks the dependency of some other
  340. package. This can have serious side effects, downgrading
  341. essential system components can even make your whole
  342. system unusable. Use with care.\fP
  343. \fBconfigure\-any\fP:
  344. Configure also any unpacked but unconfigured packages on which the current
  345. package depends.
  346. \fBhold\fP:
  347. Process packages even when marked "hold".
  348. \fBremove\-reinstreq\fP:
  349. Remove a package, even if it's broken and marked to require
  350. reinstallation. This may, for example, cause parts of the package to
  351. remain on the system, which will then be forgotten by \fBdpkg\fP.
  352. \fBremove\-essential\fP:
  353. Remove, even if the package is considered essential. Essential
  354. packages contain mostly very basic Unix commands. Removing them might
  355. cause the whole system to stop working, so use with caution.
  356. \fBdepends\fP:
  357. Turn all dependency problems into warnings.
  358. \fBdepends\-version\fP:
  359. Don't care about versions when checking dependencies.
  360. \fBbreaks\fP:
  361. Install, even if this would break another package.
  362. \fBconflicts\fP:
  363. Install, even if it conflicts with another package. This is dangerous,
  364. for it will usually cause overwriting of some files.
  365. \fBconfmiss\fP:
  366. Always install a missing conffile. This is dangerous,
  367. since it means not preserving a change (removing) made to the
  368. file.
  369. \fBconfnew\fP:
  370. If a conffile has been modified always install the new version without
  371. prompting, unless the \fB\-\-force\-confdef\fP is also specified, in
  372. which case the default action is preferred.
  373. \fBconfold\fP:
  374. If a conffile has been modified always keep the old version without
  375. prompting, unless the \fB\-\-force\-confdef\fP is also specified, in
  376. which case the default action is preferred.
  377. \fBconfdef\fP:
  378. If a conffile has been modified always choose the default action. If
  379. there is no default action it will stop to ask the user unless
  380. \fB\-\-force\-confnew\fP or \fB\-\-force\-confold\fP is also been given, in
  381. which case it will use that to decide the final action.
  382. \fBconfask\fP:
  383. If a conffile has been modified always offer to replace it with the
  384. version in the package, even if the version in the package did not
  385. change. If any of \fB\-\-force\-confmiss\fP, \fB\-\-force\-confnew\fP,
  386. \fB\-\-force\-confold\fP, or \fB\-\-force\-confdef\fP is also given,
  387. it will be used to decide the final action.
  388. \fBoverwrite\fP:
  389. Overwrite one package's file with another's file.
  390. \fBoverwrite\-dir\fP
  391. Overwrite one package's directory with another's file.
  392. \fBoverwrite\-diverted\fP:
  393. Overwrite a diverted file with an undiverted version.
  394. \fBunsafe\-io\fP:
  395. Do not perform safe I/O operations when unpacking. Currently this
  396. implies not performing file system syncs before file renames, which is
  397. known to cause substantial performance degradation on some file systems,
  398. unfortunately the ones that require the safe I/O on the first place due
  399. to their unreliable behaviour causing zero-length files on abrupt
  400. system crashes.
  401. \fINote\fP: For ext4, the main offender, consider using instead the
  402. mount option \fBnodelalloc\fP, which will fix both the performance
  403. degradation and the data safety issues, the latter by making the file
  404. system not produce zero-length files on abrupt system crashes with
  405. any software not doing syncs before atomic renames.
  406. \fIWarning: Using this option might improve performance at the cost of
  407. losing data, use with care.\fP
  408. \fBarchitecture\fP:
  409. Process even packages with wrong or no architecture.
  410. \fBbad\-version\fP:
  411. Process even packages with wrong versions.
  412. \fBbad\-path\fP:
  413. \fBPATH\fP is missing important programs, so problems are likely.
  414. \fBnot\-root\fP:
  415. Try to (de)install things even when not root.
  416. \fBbad\-verify\fP:
  417. Install a package even if it fails authenticity check.
  418. .TP
  419. \fB\-\-ignore\-depends\fP=\fIpackage\fP,...
  420. Ignore dependency-checking for specified packages (actually, checking is
  421. performed, but only warnings about conflicts are given, nothing else).
  422. .TP
  423. \fB\-\-no\-act\fP, \fB\-\-dry\-run\fP, \fB\-\-simulate\fP
  424. Do everything which is supposed to be done, but don't write any
  425. changes. This is used to see what would happen with the specified
  426. action, without actually modifying anything.
  427. Be sure to give \fB\-\-no\-act\fP before the action-parameter, or you might
  428. end up with undesirable results. (e.g. \fBdpkg \-\-purge foo
  429. \-\-no\-act\fP will first purge package foo and then try to purge package
  430. \-\-no\-act, even though you probably expected it to actually do nothing)
  431. .TP
  432. \fB\-R\fP, \fB\-\-recursive\fP
  433. Recursively handle all regular files matching pattern \fB*.deb\fP
  434. found at specified directories and all of its subdirectories. This can
  435. be used with \fB\-i\fP, \fB\-A\fP, \fB\-\-install\fP, \fB\-\-unpack\fP and
  436. \fB\-\-avail\fP actions.
  437. .TP
  438. \fB\-G\fP
  439. Don't install a package if a newer version of the same package is already
  440. installed. This is an alias of \fB\-\-refuse\-downgrade\fP.
  441. .TP
  442. .BI \-\-admindir= dir
  443. Change default administrative directory, which contains many files that
  444. give information about status of installed or uninstalled packages, etc.
  445. (Defaults to \fI/var/lib/dpkg\fP)
  446. .TP
  447. .BI \-\-instdir= dir
  448. Change default installation directory which refers to the directory where
  449. packages are to be installed. \fBinstdir\fP is also the directory passed
  450. to \fBchroot\fP(2) before running package's installation scripts, which
  451. means that the scripts see \fBinstdir\fP as a root directory.
  452. (Defaults to \fI/\fP)
  453. .TP
  454. .BI \-\-root= dir
  455. Changing \fBroot\fP changes \fBinstdir\fP to \fIdir\fP and \fBadmindir\fP
  456. to \fIdir\fP\fB/var/lib/dpkg\fP.
  457. .TP
  458. \fB\-O\fP, \fB\-\-selected\-only\fP
  459. Only process the packages that are selected for installation. The
  460. actual marking is done with \fBdselect\fP or by \fBdpkg\fP, when it
  461. handles packages. For example, when a package is removed, it will
  462. be marked selected for deinstallation.
  463. .TP
  464. .BR \-E ", " \-\-skip\-same\-version
  465. Don't install the package if the same version of the package is already
  466. installed.
  467. .P
  468. .BI \-\-pre\-invoke= command
  469. .br
  470. .BI \-\-post\-invoke= command
  471. .RS
  472. Set an invoke hook \fIcommand\fP to be run via \*(lqsh \-c\*(rq before or
  473. after the dpkg run for the \fIunpack\fP, \fIconfigure\fP, \fIinstall\fP,
  474. \fItriggers\-only\fP, \fIremove\fP and \fIpurge\fP dpkg actions. This
  475. option can be specified multiple times. The order the options are specified
  476. is preserved, with the ones from the configuration files taking precedence.
  477. The environment variable \fBDPKG_HOOK_ACTION\fP is set for the hooks to the
  478. current dpkg action. Note: front-ends might call dpkg several times per
  479. invocation, which might run the hooks more times than expected.
  480. .RE
  481. .P
  482. .BI \-\-path\-exclude= glob-pattern
  483. .br
  484. .BI \-\-path\-include= glob-pattern
  485. .RS
  486. Set \fIglob-pattern\fP as a path filter, either by excluding or re-including
  487. previously excluded paths matching the specified patterns during install.
  488. \fIWarning: take into account that depending on the excluded paths you
  489. might completely break your system, use with caution.\fP
  490. The glob patterns use the same wildcards used in the shell, were '*' matches
  491. any sequence of characters, including the empty string and also '/'. For
  492. example, \fI'/usr/*/READ*'\fP matches \fI'/usr/share/doc/package/README'\fP.
  493. As usual, '?' matches any single character (again, including '/'). And '['
  494. starts a character class, which can contain a list of characters, ranges
  495. and complementations. See \fBglob\fP(7) for detailed information about
  496. globbing. Note: the current implementation might re-include more directories
  497. and symlinks than needed, to be on the safe side and avoid possible unpack
  498. failures, future work might fix this.
  499. This can be used to remove all paths except some particular ones; a typical
  500. case is:
  501. .nf
  502. .B \-\-path\-exclude=/usr/share/doc/*
  503. .B \-\-path\-include=/usr/share/doc/*/copyright
  504. .fi
  505. to remove all documentation files except the copyright files.
  506. These two options can be specified multiple times, and interleaved with
  507. each other. Both are processed in the given order, with the last rule that
  508. matches a file name making the decision.
  509. .RE
  510. .TP
  511. \fB\-\-status\-fd \fR\fIn\fR
  512. Send machine-readable package status and progress information to file
  513. descriptor \fIn\fP. This option can be specified multiple times. The
  514. information is generally one record per line, in one of the following
  515. forms:
  516. .RS
  517. .TP
  518. .BI "status: " package ": " status
  519. Package status changed; \fIstatus\fR is as in the status file.
  520. .TP
  521. .BI "status: " package " : error : " extended-error-message
  522. An error occurred. Any possible newlines in \fIextended-error-message\fR
  523. will be converted to spaces before output.
  524. .TP
  525. .BI "status: " file " : conffile\-prompt : '" real-old "' '" real-new "' " useredited " " distedited
  526. User is being asked a conffile question.
  527. .TP
  528. .BI "processing: " stage ": " package
  529. Sent just before a processing stage starts. \fIstage\fR is one of
  530. .BR upgrade ", " install " (both sent before unpacking),"
  531. .BR configure ", " trigproc ", " disappear ", " remove ", " purge .
  532. .RE
  533. .TP
  534. \fB\-\-status\-logger\fR=\fIcommand\fR
  535. Send machine-readable package status and progress information to the
  536. shell \fIcommand\fR's standard input. This option can be specified
  537. multiple times. The output format used is the same as in \fB\-\-status\-fd.
  538. .RE
  539. .TP
  540. \fB\-\-log=\fP\fIfilename\fP
  541. Log status change updates and actions to \fIfilename\fP, instead of
  542. the default \fI/var/log/dpkg.log\fP. If this option is given multiple
  543. times, the last filename is used. Log messages are of the form
  544. `YYYY-MM-DD HH:MM:SS status \fIstate\fP \fIpkg\fP \fIinstalled-version\fP'
  545. for status change updates;
  546. `YYYY-MM-DD HH:MM:SS \fIaction\fP \fIpkg\fP \fIinstalled-version\fP
  547. \fIavailable-version\fP' for actions where \fIaction\fP is one of
  548. \fBinstall\fP, \fBupgrade\fP, \fBremove\fP, \fBpurge\fP; and
  549. `YYYY-MM-DD HH:MM:SS conffile \fIfilename\fP \fIdecision\fP' for conffile
  550. changes where \fIdecision\fP is either \fBinstall\fP or \fBkeep\fP.
  551. .TP
  552. \fB\-\-no\-debsig\fP
  553. Do not try to verify package signatures.
  554. .TP
  555. \fB\-\-no\-triggers\fP
  556. Do not run any triggers in this run (activations will still be recorded).
  557. If used with \fB\-\-configure\fP \fIpackage\fP or
  558. \fB\-\-triggers\-only\fP \fIpackage\fP then the named package postinst
  559. will still be run even if only a triggers run is needed. Use of this option
  560. may leave packages in the improper \fBtriggers\-awaited\fP and
  561. \fBtriggers\-pending\fP states. This can be fixed later by running:
  562. \fBdpkg \-\-configure \-\-pending\fP.
  563. .TP
  564. \fB\-\-triggers\fP
  565. Cancels a previous \fB\-\-no\-triggers\fP.
  566. .
  567. .SH FILES
  568. .TP
  569. .I /etc/dpkg/dpkg.cfg
  570. Configuration file with default options.
  571. .TP
  572. .I /var/log/dpkg.log
  573. Default log file (see \fI/etc/dpkg/dpkg.cfg\fP(5) and option
  574. \fB\-\-log\fP).
  575. .P
  576. The other files listed below are in their default directories, see option
  577. \fB\-\-admindir\fP to see how to change locations of these files.
  578. .TP
  579. .I /var/lib/dpkg/available
  580. List of available packages.
  581. .TP
  582. .I /var/lib/dpkg/status
  583. Statuses of available packages. This file contains information about
  584. whether a package is marked for removing or not, whether it is
  585. installed or not, etc. See section \fBINFORMATION ABOUT PACKAGES\fP
  586. for more info.
  587. The status file is backed up daily in \fI/var/backups\fP. It can be
  588. useful if it's lost or corrupted due to filesystems troubles.
  589. .P
  590. The following files are components of a binary package. See \fBdeb\fP(5)
  591. for more information about them:
  592. .TP
  593. .I control
  594. .TP
  595. .I conffiles
  596. .TP
  597. .I preinst
  598. .TP
  599. .I postinst
  600. .TP
  601. .I prerm
  602. .TP
  603. .I postrm
  604. .
  605. .SH ENVIRONMENT
  606. .TP
  607. .B HOME
  608. If set, \fBdpkg\fP will use it as the directory from which to read the user
  609. specific configuration file.
  610. .TP
  611. .B TMPDIR
  612. If set, \fBdpkg\fP will use it as the directory in which to create
  613. temporary files and directories.
  614. .TP
  615. .B PAGER
  616. The program \fBdpkg\fP will execute when displaying the conffiles.
  617. .TP
  618. .B SHELL
  619. The program \fBdpkg\fP will execute when starting a new shell.
  620. .TP
  621. .B COLUMNS
  622. Sets the number of columns \fBdpkg\fP should use when displaying formatted
  623. text. Currently only used by \-l.
  624. .TP
  625. .B DPKG_SHELL_REASON
  626. Defined by \fBdpkg\fP on the shell spawned on the conffile prompt to
  627. examine the situation. Current valid value: \fBconffile\-prompt\fP.
  628. .TP
  629. .B DPKG_CONFFILE_OLD
  630. Defined by \fBdpkg\fP on the shell spawned on the conffile prompt to
  631. examine the situation. Contains the path to the old conffile.
  632. .TP
  633. .B DPKG_CONFFILE_NEW
  634. Defined by \fBdpkg\fP on the shell spawned on the conffile prompt to
  635. examine the situation. Contains the path to the new conffile.
  636. .TP
  637. .B DPKG_RUNNING_VERSION
  638. Defined by \fBdpkg\fP on the maintainer script environment to the
  639. version of the currently running \fBdpkg\fP instance.
  640. .TP
  641. .B DPKG_MAINTSCRIPT_PACKAGE
  642. Defined by \fBdpkg\fP on the maintainer script environment to the
  643. package name being handled.
  644. .TP
  645. .B DPKG_MAINTSCRIPT_ARCH
  646. Defined by \fBdpkg\fP on the maintainer script environment to the
  647. architecture the package got built for.
  648. .TP
  649. .B DPKG_MAINTSCRIPT_NAME
  650. Defined by \fBdpkg\fP on the maintainer script environment to the
  651. name of the script running (preinst, postinst, prerm, postrm).
  652. .
  653. .SH EXAMPLES
  654. To list packages related to the editor \fBvi\fP(1):
  655. .br
  656. \fB dpkg \-l \(aq*vi*\(aq\fP
  657. .br
  658. To see the entries in \fI/var/lib/dpkg/available\fP of two packages:
  659. .br
  660. \fB dpkg \-\-print\-avail elvis vim | less\fP
  661. .br
  662. To search the listing of packages yourself:
  663. .br
  664. \fB less /var/lib/dpkg/available\fP
  665. .br
  666. To remove an installed elvis package:
  667. .br
  668. \fB dpkg \-r elvis\fP
  669. .br
  670. To install a package, you first need to find it in an archive or
  671. CDROM. The "available" file shows that the vim package is in section
  672. "editors":
  673. .br
  674. \fB cd /media/cdrom/pool/main/v/vim\fP
  675. \fB dpkg \-i vim_4.5\-3.deb\fP
  676. .br
  677. To make a local copy of the package selection states:
  678. .br
  679. \fB dpkg \-\-get\-selections >myselections\fP
  680. .br
  681. You might transfer this file to another computer, and install it there
  682. with:
  683. .br
  684. \fB dpkg \-\-clear\-selections\fP
  685. \fB dpkg \-\-set\-selections <myselections\fP
  686. .br
  687. Note that this will not actually install or remove anything, but just
  688. set the selection state on the requested packages. You will need some
  689. other application to actually download and install the requested
  690. packages. For example, run \fBapt\-get dselect\-upgrade\fP.
  691. Ordinarily, you will find that \fBdselect\fP(1) provides a more
  692. convenient way to modify the package selection states.
  693. .br
  694. .
  695. .SH ADDITIONAL FUNCTIONALITY
  696. Additional functionality can be gained by installing any of the
  697. following packages: \fBapt\fR, \fBaptitude\fR and \fBdebsums\fR.
  698. .
  699. .SH SEE ALSO
  700. \fBaptitude\fP(1),
  701. \fBapt\fP(1),
  702. \fBdselect\fP(1),
  703. \fBdpkg\-deb\fP(1),
  704. \fBdpkg\-query\fP(1),
  705. \fBdeb\fP(5),
  706. \fBdeb\-control\fP(5),
  707. \fBdpkg.cfg\fP(5),
  708. and
  709. \fBdpkg\-reconfigure\fP(8).
  710. .
  711. .SH BUGS
  712. \fB\-\-no\-act\fP usually gives less information than might be helpful.
  713. .
  714. .SH AUTHORS
  715. See \fI/usr/share/doc/dpkg/THANKS\fP for the list of people who have
  716. contributed to \fBdpkg\fP.