1 <!-- -*- mode: sgml; mode: fold -*- -->
2 <!doctype refentry PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [
4 <!ENTITY % aptent SYSTEM "apt.ent">
13 <refentrytitle>apt-get</>
17 <!-- Man page title -->
20 <refpurpose>APT package handling utility -- command-line interface</>
27 <arg><option>-hvs</></arg>
28 <arg><option>-o=<replaceable/config string/</></arg>
29 <arg><option>-c=<replaceable/file/</></arg>
33 <arg>dselect-upgrade</>
34 <arg>install <arg choice="plain" rep="repeat"><replaceable>pkg</replaceable></arg></arg>
35 <arg>remove <arg choice="plain" rep="repeat"><replaceable>pkg</replaceable></arg></arg>
36 <arg>source <arg choice="plain" rep="repeat"><replaceable>pkg</replaceable></arg></arg>
37 <arg>build-dep <arg choice="plain" rep="repeat"><replaceable>pkg</replaceable></arg></arg>
45 <RefSect1><Title>Description</>
47 <command/apt-get/ is the command-line tool for handling packages, and may be
48 considered the user's "back-end" to other tools using the APT library.
50 Unless the <option/-h/, or <option/--help/ option is given one of the
51 commands below must be present.
54 <VarListEntry><Term>update</Term>
56 <literal/update/ is used to resynchronize the package index files from
57 their sources. The indexes of available packages are fetched from the
58 location(s) specified in <filename>/etc/apt/sources.list</>.
59 For example, when using a Debian archive, this command retrieves and
60 scans the <filename>Packages.gz</> files, so that information about new
61 and updated packages is available. An <literal/update/ should always be
62 performed before an <literal/upgrade/ or <literal/dist-upgrade/. Please
63 be aware that the overall progress meter will be incorrect as the size
64 of the package files cannot be known in advance.
67 <VarListEntry><Term>upgrade</Term>
69 <literal/upgrade/ is used to install the newest versions of all packages
70 currently installed on the system from the sources enumerated in
71 <filename>/etc/apt/sources.list</>. Packages currently installed with
72 new versions available are retrieved and upgraded; under no circumstances
73 are currently installed packages removed, or packages not already installed
74 retrieved and installed. New versions of currently installed packages that
75 cannot be upgraded without changing the install status of another package
76 will be left at their current version. An <literal/update/ must be
77 performed first so that <command/apt-get/ knows that new versions of packages are
81 <VarListEntry><Term>dselect-upgrade</Term>
83 is used in conjunction with the traditional Debian GNU/Linux packaging
84 front-end, &dselect;. <literal/dselect-upgrade/
85 follows the changes made by &dselect; to the <literal/Status/
86 field of available packages, and performs the actions necessary to realize
87 that state (for instance, the removal of old and the installation of new
91 <VarListEntry><Term>dist-upgrade</Term>
93 <literal/dist-upgrade/, in addition to performing the function of
94 <literal/upgrade/, also intelligently handles changing dependencies
95 with new versions of packages; <command/apt-get/ has a "smart" conflict
96 resolution system, and it will attempt to upgrade the most important
97 packages at the expense of less important ones if necessary.
98 The <filename>/etc/apt/sources.list</> file contains a list of locations
99 from which to retrieve desired package files.
102 <VarListEntry><Term>install</Term>
104 <literal/install/ is followed by one or more packages desired for
105 installation. Each package is a package name, not a fully qualified
106 filename (for instance, in a Debian GNU/Linux system, libc6 would be the
107 argument provided, not em(libc6_1.9.6-2.deb)). All packages required
108 by the package(s) specified for installation will also be retrieved and
109 installed. The <filename>/etc/apt/sources.list</> file is used to locate
110 the desired packages. If a hyphen is appended to the package name (with
111 no intervening space), the identified package will be removed if it is
112 installed. Similarly a plus sign can be used to designate a package to
113 install. These latter features may be used to override decisions made by
114 apt-get's conflict resolution system.
116 A specific version of a package can be selected for installation by
117 following the package name with an equals and the version of the package
118 to select. This will cause that version to be located and selected for
119 install. Alternatively a specific distribution can be selected by
120 following the package name with a slash and the version of the
121 distribution or the Archive name (stable, frozen, unstable).
123 Both of the version selection mechanisms can downgrade packages and must
126 If no package matches the given expression and the expression contains one
127 of '.', '?' or '*' then it is assumed to be a POSIX regex and it is applied
128 to all package names in the database. Any matches are then installed (or
129 removed). Note that matching is done by substring so 'lo.*' matches 'how-lo'
130 and 'lowest'. If this is undesired prefix with a '^' character.
133 <VarListEntry><Term>remove</Term>
135 <literal/remove/ is identical to <literal/install/ except that packages are
136 removed instead of installed. If a plus sign is appended to the package
137 name (with no intervening space), the identified package will be
141 <VarListEntry><Term>source</Term>
143 <literal/source/ causes <command/apt-get/ to fetch source packages. APT
144 will examine the available packages to decide which source package to
145 fetch. It will then find and download into the current directory the
146 newest available version of that source package. Source packages are
147 tracked separately from binary packages via <literal/deb-src/ type lines
148 in the &sources-list; file. This probably will mean that you will not
149 get the same source as the package you have installed or as you could
150 install. If the --compile options is specified then the package will be
151 compiled to a binary .deb using dpkg-buildpackage, if --download-only is
152 specified then the source package will not be unpacked.
154 A specific source version can be retrieved by postfixing the source name
155 with an equals and then the version to fetch, similar to the mechanism
156 used for the package files. This enables exact matching of the source
157 package name and version, implicitly enabling the
158 <literal/APT::Get::Only-Source/ option.
161 Note that source packages are not tracked like binary packages, they
162 exist only in the current directory and are similar to downloading source
166 <VarListEntry><Term>build-dep</Term>
168 <literal/build-dep/ causes apt-get to install/remove packages in an
169 attempt to satisfy the build dependencies for a source packages.
172 <VarListEntry><Term>check</Term>
174 <literal/check/ is a diagnostic tool; it updates the package cache and checks
175 for broken dependencies.
178 <VarListEntry><Term>clean</Term>
180 <literal/clean/ clears out the local repository of retrieved package
181 files. It removes everything but the lock file from
182 <filename>&cachedir;/archives/</> and
183 <filename>&cachedir;/archive/partial/</>. When APT is used as a
184 &dselect; method, <literal/clean/ is run automatically.
185 Those who do not use dselect will likely want to run <literal/apt-get clean/
186 from time to time to free up disk space.
189 <VarListEntry><Term>autoclean</Term>
191 Like <literal/clean/, <literal/autoclean/ clears out the local
192 repository of retrieved package files. The difference is that it only
193 removes package files that can no longer be downloaded, and are largely
194 useless. This allows a cache to be maintained over a long period without
195 it growing out of control. The configuration option
196 <literal/APT::Clean-Installed/ will prevent installed packages from being
197 erased if it is set off.
202 <RefSect1><Title>Options</>
206 <VarListEntry><term><option/-d/</><term><option/--download-only/</>
208 Download only; package files are only retrieved, not unpacked or installed.
209 Configuration Item: <literal/APT::Get::Download-Only/.
212 <VarListEntry><term><option/-f/</><term><option/--fix-broken/</>
214 Fix; attempt to correct a system with broken dependencies in
215 place. This option, when used with install/remove, can omit any packages
216 to permit APT to deduce a likely soltion. Any Package that are specified
217 must completly correct the problem. The option is sometimes necessary when
218 running APT for the first time; APT itself does not allow broken package
219 dependencies to exist on a system. It is possible that a system's
220 dependency structure can be so corrupt as to require manual intervention
221 (which usually means using &dselect; or <command/dpkg --remove/ to eliminate some of
222 the offending packages). Use of this option together with <option/-m/ may produce an
223 error in some situations.
224 Configuration Item: <literal/APT::Get::Fix-Broken/.
227 <VarListEntry><term><option/-m/</><term><option/--ignore-missing/</>
228 <term><option/--fix-missing/</>
230 Ignore missing packages; If packages cannot be retrieved or fail the
231 integrity check after retrieval (corrupted package files), hold back
232 those packages and handle the result. Use of this option together with
233 <option/-f/ may produce an error in some situations. If a package is
234 selected for installation (particularly if it is mentioned on the
235 command line) and it could not be downloaded then it will be silently
237 Configuration Item: <literal/APT::Get::Fix-Missing/.
240 <VarListEntry><term><option/--no-download/</>
242 Disables downloading of packages. This is best used with
243 <option/--ignore-missing/ to force APT to use only the .debs it has
245 Configuration Item: <literal/APT::Get::Download/.
248 <VarListEntry><term><option/-q/</><term><option/--quiet/</>
250 Quiet; produces output suitable for logging, omitting progress indicators.
251 More q's will produce more quiet up to a maximum of 2. You can also use
252 <option/-q=#/ to set the quiet level, overriding the configuration file.
253 Note that quiet level 2 implies <option/-y/, you should never use -qq
254 without a no-action modifier such as -d, --print-uris or -s as APT may
255 decided to do something you did not expect.
256 Configuration Item: <literal/quiet/.
259 <VarListEntry><term><option/-s/</>
260 <term><option/--simulate/</>
261 <term><option/--just-print/</>
262 <term><option/--dry-run/</>
263 <term><option/--recon/</>
264 <term><option/--no-act/</>
266 No action; perform a simulation of events that would occur but do not
267 actually change the system.
268 Configuration Item: <literal/APT::Get::Simulate/.
271 a series of lines each one representing a dpkg operation, Configure (Conf),
272 Remove (Remv), Unpack (Inst). Square brackets indicate broken packages with
273 and empty set of square brackets meaning breaks that are of no consequence
277 <VarListEntry><term><option/-y/</><term><option/--yes/</>
278 <term><option/--assume-yes/</>
280 Automatic yes to prompts; assume "yes" as answer to all prompts and run
281 non-interactively. If an undesirable situation, such as changing a held
282 package or removing an essential package occurs then <literal/apt-get/
284 Configuration Item: <literal/APT::Get::Assume-Yes/.
287 <VarListEntry><term><option/-u/</><term><option/--show-upgraded/</>
289 Show upgraded packages; Print out a list of all packages that are to be
291 Configuration Item: <literal/APT::Get::Show-Upgraded/.
294 <VarListEntry><term><option/-b/</><term><option/--compile/</>
295 <term><option/--build/</>
297 Compile source packages after downloading them.
298 Configuration Item: <literal/APT::Get::Compile/.
301 <VarListEntry><term><option/--ignore-hold/</>
303 Ignore package Holds; This causes <command/apt-get/ to ignore a hold
304 placed on a package. This may be useful in conjunction with
305 <literal/dist-upgrade/ to override a large number of undesired holds.
306 Configuration Item: <literal/APT::Ignore-Hold/.
309 <VarListEntry><term><option/--no-upgrade/</>
311 Do not upgrade packages; When used in conjunction with <literal/install/
312 <literal/no-upgrade/ will prevent packages listed from being upgraded
313 if they are already installed.
314 Configuration Item: <literal/APT::Get::Upgrade/.
317 <VarListEntry><term><option/--force-yes/</>
319 Force yes; This is a dangerous option that will cause apt to continue
320 without prompting if it is doing something potentially harmful. It
321 should not be used except in very special situations. Using
322 <literal/force-yes/ can potentially destroy your system!
323 Configuration Item: <literal/APT::Get::force-yes/.
326 <VarListEntry><term><option/--print-uris/</>
328 Instead of fetching the files to install their URIs are printed. Each
329 URI will have the path, the destination file name, the size and the expected
330 md5 hash. Note that the file name to write to will not always match
331 the file name on the remote site! This also works with the
332 <literal/source/ and <literal/update/ commands. When used with the
333 <literal/update/ command the MD5 and size are not included, and it is
334 up to the user to decompress any compressed files.
335 Configuration Item: <literal/APT::Get::Print-URIs/.
338 <VarListEntry><term><option/--purge/</>
340 Use purge instead of remove for anything that would be removed.
341 Configuration Item: <literal/APT::Get::Purge/.
344 <VarListEntry><term><option/--reinstall/</>
346 Re-Install packages that are already installed and at the newest version.
347 Configuration Item: <literal/APT::Get::ReInstall/.
350 <VarListEntry><term><option/--list-cleanup/</>
352 This option defaults to on, use <literal/--no-list-cleanup/ to turn it
353 off. When on <command/apt-get/ will automatically manage the contents of
354 <filename>&statedir;/lists</> to ensure that obsolete files are erased.
355 The only reason to turn it off is if you frequently change your source
357 Configuration Item: <literal/APT::Get::List-Cleanup/.
360 <VarListEntry><term><option/-t/</>
361 <term><option/--target-release/</>
362 <term><option/--default-release/</>
364 This option controls the default input to the policy engine, it creates
365 a default pin at priority 990 using the specified release string. The
366 preferences file may further override this setting. In short, this option
367 lets you have simple control over which distribution packages will be
368 retrieved from. Some common examples might be
369 <option>-t '2.1*'</> or <option>-t unstable</>.
370 Configuration Item: <literal/APT::Default-Release/
373 <VarListEntry><term><option/--trivial-only/</>
375 Only perform operations that are 'trivial'. Logically this can be considered
376 related to <option/--assume-yes/, where <option/--assume-yes/ will answer
377 yes to any prompt, <option/--trivial-only/ will answer no.
378 Configuration Item: <literal/APT::Get::Trivial-Only/.
381 <VarListEntry><term><option/--no-remove/</>
383 If any packages are to be removed apt-get immediately aborts without
385 Configuration Item: <literal/APT::Get::Remove/
388 <VarListEntry><term><option/--only-source/</>
390 Only has meaning for the <literal/source/ command. indicates that the
391 given source names are not to be mapped through the binary table.
392 Configuration Item: <literal/APT::Get::Only-Source/
395 <VarListEntry><term><option/--diff-only/</><term><option/--tar-only/</>
397 Download only the diff or tar file of a source archive.
398 Configuration Item: <literal/APT::Get::Diff-Only/ and
399 <literal/APT::Get::Tar-Only/
402 <VarListEntry><term><option/--arch-only/</>
404 Only process architecture-dependent build-dependencies.
405 Configuration Item: <literal/APT::Get::Arch-Only/
413 <RefSect1><Title>Files</>
415 <VarListEntry><term><filename>/etc/apt/sources.list</></term>
417 locations to fetch packages from.
418 Configuration Item: <literal/Dir::Etc::SourceList/.
421 <VarListEntry><term><filename>/etc/apt/apt.conf</></term>
423 APT configuration file.
424 Configuration Item: <literal/Dir::Etc::Main/.
427 <VarListEntry><term><filename>/etc/apt/apt.conf.d/</></term>
429 APT configuration file fragments
430 Configuration Item: <literal/Dir::Etc::Parts/.
433 <VarListEntry><term><filename>/etc/apt/preferences</></term>
435 version preferences file
436 Configuration Item: <literal/Dir::Etc::Preferences/.
439 <VarListEntry><term><filename>&cachedir;/archives/</></term>
441 storage area for retrieved package files.
442 Configuration Item: <literal/Dir::Cache::Archives/.
445 <VarListEntry><term><filename>&cachedir;/archives/partial/</></term>
447 storage area for package files in transit.
448 Configuration Item: <literal/Dir::Cache::Archives/ (implicit partial).
451 <VarListEntry><term><filename>&statedir;/lists/</></term>
453 storage area for state information for each package resource specified in
455 Configuration Item: <literal/Dir::State::Lists/.
458 <VarListEntry><term><filename>&statedir;/lists/partial/</></term>
460 storage area for state information in transit.
461 Configuration Item: <literal/Dir::State::Lists/ (implicit partial).
466 <RefSect1><Title>See Also</>
468 &apt-cache;, &apt-cdrom;, &dpkg;, &dselect;, &sources-list;, &apt-conf;,
469 The APT User's guide in &docdir;, &apt-preferences;.
472 <RefSect1><Title>Diagnostics</>
474 <command/apt-get/ returns zero on normal operation, decimal 100 on error.