]>
Commit | Line | Data |
---|---|---|
b2e465d6 AL |
1 | <!-- -*- mode: sgml; mode: fold -*- --> |
2 | <!doctype refentry PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [ | |
3 | ||
4 | <!ENTITY % aptent SYSTEM "apt.ent"> | |
5 | %aptent; | |
6 | ||
7 | ]> | |
8 | ||
9 | <refentry> | |
10 | &apt-docinfo; | |
11 | ||
12 | <refmeta> | |
13 | <refentrytitle>apt-get</> | |
14 | <manvolnum>8</> | |
15 | </refmeta> | |
16 | ||
17 | <!-- Man page title --> | |
18 | <refnamediv> | |
19 | <refname>apt-get</> | |
20 | <refpurpose>APT package handling utility -- command-line interface</> | |
21 | </refnamediv> | |
22 | ||
23 | <!-- Arguments --> | |
24 | <refsynopsisdiv> | |
25 | <cmdsynopsis> | |
26 | <command>apt-config</> | |
27 | <arg><option>-hvs</></arg> | |
28 | <arg><option>-o=<replaceable/config string/</></arg> | |
29 | <arg><option>-c=<replaceable/file/</></arg> | |
30 | <group choice=req> | |
31 | <arg>update</> | |
32 | <arg>upgrade</> | |
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> | |
38 | <arg>check</> | |
39 | <arg>clean</> | |
40 | <arg>autoclean</> | |
41 | </group> | |
42 | </cmdsynopsis> | |
43 | </refsynopsisdiv> | |
44 | ||
45 | <RefSect1><Title>Description</> | |
46 | <para> | |
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. | |
49 | <para> | |
50 | Unless the <option/-h/, or <option/--help/ option is given one of the | |
51 | above commands must be present. | |
52 | ||
53 | <VariableList> | |
54 | <VarListEntry><Term>update</Term> | |
55 | <ListItem><Para> | |
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. | |
65 | </VarListEntry> | |
66 | ||
67 | <VarListEntry><Term>upgrade</Term> | |
68 | <ListItem><Para> | |
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 | |
78 | available. | |
79 | </VarListEntry> | |
80 | ||
81 | <VarListEntry><Term>dselect-upgrade</Term> | |
82 | <ListItem><Para> | |
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 | |
88 | packages). | |
89 | </VarListEntry> | |
90 | ||
91 | <VarListEntry><Term>dist-upgrade</Term> | |
92 | <ListItem><Para> | |
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. | |
100 | </VarListEntry> | |
101 | ||
102 | <VarListEntry><Term>install</Term> | |
103 | <ListItem><Para> | |
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 | isntall. These latter feature may be used to override decisions made by | |
114 | apt-get's conflict resolution system. | |
115 | <para> | |
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). | |
122 | <para> | |
123 | Both of the version selection mechansims can downgrade packages and must | |
124 | be used with care. | |
125 | <para> | |
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. | |
131 | </VarListEntry> | |
132 | ||
133 | <VarListEntry><Term>remove</Term> | |
134 | <ListItem><Para> | |
135 | <literal/remove/ is identical to bf(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 | |
138 | installed. | |
139 | </VarListEntry> | |
140 | ||
141 | <VarListEntry><Term>source</Term> | |
142 | <ListItem><Para> | |
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. | |
153 | <para> | |
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. | |
159 | ||
160 | <para> | |
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 | |
163 | tar balls. | |
164 | </VarListEntry> | |
165 | ||
166 | <VarListEntry><Term>build-dep</Term> | |
167 | <ListItem><Para> | |
168 | <literal/build-dep/ causes apt-get to install/remove packages in an | |
169 | attempt to satisfy the build dependencies for a source packages. Right | |
170 | now virtual package build depends choose a package at random. | |
171 | </VarListEntry> | |
172 | ||
173 | <VarListEntry><Term>check</Term> | |
174 | <ListItem><Para> | |
175 | <literal/check/ is a diagnostic tool; it updates the package cache and checks | |
176 | for broken dependencies. | |
177 | </VarListEntry> | |
178 | ||
179 | <VarListEntry><Term>clean</Term> | |
180 | <ListItem><Para> | |
181 | <literal/clean/ clears out the local repository of retrieved package | |
182 | files. It removes everything but the lock file from | |
183 | <filename>&cachedir;/archives/</> and | |
184 | <filename>&cachedir;/archive/partial/</>. When APT is used as a | |
185 | &dselect; method, <literal/clean/ is run automatically. | |
186 | Those who do not use dselect will likely want to run <literal/apt-get clean/ | |
187 | from time to time to free up disk space. | |
188 | </VarListEntry> | |
189 | ||
190 | <VarListEntry><Term>autoclean</Term> | |
191 | <ListItem><Para> | |
192 | Like <literal/clean/, <literal/autoclean/ clears out the local | |
193 | repository of retrieved package files. The difference is that it only | |
194 | removes package files that can no longer be downloaded, and are largely | |
195 | useless. This allows a cache to be maintained over a long period without | |
196 | it growing out of control. The configuration option | |
197 | <literal/APT::Clean-Installed/ will prevent installed packages from being | |
198 | erased if it is set off. | |
199 | </VarListEntry> | |
200 | </VariableList> | |
201 | </RefSect1> | |
202 | ||
203 | <RefSect1><Title>Options</> | |
204 | &apt-cmdblurb; | |
205 | ||
206 | <VariableList> | |
207 | <VarListEntry><term><option/-d/</><term><option/--download-only/</> | |
208 | <ListItem><Para> | |
209 | Download only; package files are only retrieved, not unpacked or installed. | |
210 | Configuration Item: <literal/APT::Get::Download-Only/. | |
211 | </VarListEntry> | |
212 | ||
213 | <VarListEntry><term><option/-f/</><term><option/--fix-broken/</> | |
214 | <ListItem><Para> | |
215 | Fix; attempt to correct a system with broken dependencies in | |
216 | place. This option, when used with install/remove, can omit any packages | |
217 | to permit APT to deduce a likely soltion. Any Package that are specified | |
218 | must completly correct the problem. The option is sometimes necessary when | |
219 | running APT for the first time; APT itself does not allow broken package | |
220 | dependencies to exist on a system. It is possible that a system's | |
221 | dependency structure can be so corrupt as to require manual intervention | |
222 | (which usually means using &dselect; or <command/dpkg --remove/ to eliminate some of | |
223 | the offending packages). Use of this option together with <option/-m/ may produce an | |
224 | error in some situations. | |
225 | Configuration Item: <literal/APT::Get::Fix-Broken/. | |
226 | </VarListEntry> | |
227 | ||
228 | <VarListEntry><term><option/-m/</><term><option/--ignore-missing/</> | |
229 | <term><option/--fix-missing/</> | |
230 | <ListItem><Para> | |
231 | Ignore missing packages; If packages cannot be retrieved or fail the | |
232 | integrity check after retrieval (corrupted package files), hold back | |
233 | those packages and handle the result. Use of this option together with | |
234 | <option/-f/ may produce an error in some situations. If a package is | |
235 | selected for installation (particularly if it is mentioned on the | |
236 | command line) and it could not be downloaded then it will be silently | |
237 | held back. | |
238 | Configuration Item: <literal/APT::Get::Fix-Missing/. | |
239 | </VarListEntry> | |
240 | ||
241 | <VarListEntry><term><option/--no-download/</> | |
242 | <ListItem><Para> | |
243 | Disables downloading of packages. This is best used with | |
244 | <option/--ignore-missing/ to force APT to use only the .debs it has | |
245 | already downloaded. | |
246 | Configuration Item: <literal/APT::Get::Download/. | |
247 | </VarListEntry> | |
248 | ||
249 | <VarListEntry><term><option/-q/</><term><option/--quiet/</> | |
250 | <ListItem><Para> | |
251 | Quiet; produces output suitable for logging, omitting progress indicators. | |
252 | More q's will produce more quiet up to a maximum of 2. You can also use | |
253 | <option/-q=#/ to set the quiet level, overriding the configuration file. | |
254 | Note that quiet level 2 implies <option/-y/, you should never use -qq | |
255 | without a no-action modifier such as -d, --print-uris or -s as APT may | |
256 | decided to do something you did not expect. | |
257 | Configuration Item: <literal/quiet/. | |
258 | </VarListEntry> | |
259 | ||
260 | <VarListEntry><term><option/-s/</> | |
261 | <term><option/--simulate/</> | |
262 | <term><option/--just-print/</> | |
263 | <term><option/--dry-run/</> | |
264 | <term><option/--recon/</> | |
265 | <term><option/--no-act/</> | |
266 | <ListItem><Para> | |
267 | No action; perform a simulation of events that would occur but do not | |
268 | actually change the system. | |
269 | Configuration Item: <literal/APT::Get::Simulate/. | |
270 | <para> | |
271 | Simulate prints out | |
272 | a series of lines each one representing a dpkg operation, Configure (Conf), | |
273 | Remove (Remv), Unpack (Inst). Square brackets indicate broken packages with | |
274 | and empty set of square brackets meaning breaks that are of no consequence | |
275 | (rare). | |
276 | </VarListEntry> | |
277 | ||
278 | <VarListEntry><term><option/-y/</><term><option/--yes/</> | |
279 | <term><option/--assume-yes/</> | |
280 | <ListItem><Para> | |
281 | Automatic yes to prompts; assume "yes" as answer to all prompts and run | |
282 | non-interactively. If an undesirable situation, such as changing a held | |
283 | package or removing an essential package occurs then <literal/apt-get/ | |
284 | will abort. | |
285 | Configuration Item: <literal/APT::Get::Assume-Yes/. | |
286 | </VarListEntry> | |
287 | ||
288 | <VarListEntry><term><option/-u/</><term><option/--show-upgraded/</> | |
289 | <ListItem><Para> | |
290 | Show upgraded packages; Print out a list of all packages that are to be | |
291 | upgraded. | |
292 | Configuration Item: <literal/APT::Get::Show-Upgraded/. | |
293 | </VarListEntry> | |
294 | ||
295 | <VarListEntry><term><option/-b/</><term><option/--compile/</> | |
296 | <term><option/--build/</> | |
297 | <ListItem><Para> | |
298 | Compile source packages after downloading them. | |
299 | Configuration Item: <literal/APT::Get::Compile/. | |
300 | </VarListEntry> | |
301 | ||
302 | <VarListEntry><term><option/--ignore-hold/</> | |
303 | <ListItem><Para> | |
304 | Ignore package Holds; This causes <command/apt-get/ to ignore a hold | |
305 | placed on a package. This may be useful in conjunction with | |
306 | <literal/dist-upgrade/ to override a large number of undesired holds. | |
307 | Configuration Item: <literal/APT::Ignore-Hold/. | |
308 | </VarListEntry> | |
309 | ||
310 | <VarListEntry><term><option/--no-upgrade/</> | |
311 | <ListItem><Para> | |
312 | Do not upgrade packages; When used in conjunction with <literal/install/ | |
313 | <literal/no-upgrade/ will prevent packages listed from being upgraded | |
314 | if they are already installed. | |
315 | Configuration Item: <literal/APT::Get::Upgrade/. | |
316 | </VarListEntry> | |
317 | ||
318 | <VarListEntry><term><option/--force-yes/</> | |
319 | <ListItem><Para> | |
320 | Force yes; This is a dangerous option that will cause apt to continue | |
321 | without prompting if it is doing something potentially harmful. It | |
322 | should not be used except in very special situations. Using | |
323 | <literal/force-yes/ can potentially destroy your system! | |
324 | Configuration Item: <literal/APT::Get::force-yes/. | |
325 | </VarListEntry> | |
326 | ||
327 | <VarListEntry><term><option/--print-uris/</> | |
328 | <ListItem><Para> | |
329 | Instead of fetching the files to install their URIs are printed. Each | |
330 | URI will have the path, the destination file name, the size and the expected | |
331 | md5 hash. Note that the file name to write to will not always match | |
332 | the file name on the remote site! This also works with the /source/ | |
333 | command. Configuration Item: <literal/APT::Get::Print-URIs/. | |
334 | </VarListEntry> | |
335 | ||
336 | <VarListEntry><term><option/--purge/</> | |
337 | <ListItem><Para> | |
338 | Use purge instead of remove for anything that would be removed. | |
339 | Configuration Item: <literal/APT::Get::Purge/. | |
340 | </VarListEntry> | |
341 | ||
342 | <VarListEntry><term><option/--reinstall/</> | |
343 | <ListItem><Para> | |
344 | Re-Install packages that are already installed and at the newest version. | |
345 | Configuration Item: <literal/APT::Get::ReInstall/. | |
346 | </VarListEntry> | |
347 | ||
348 | <VarListEntry><term><option/--list-cleanup/</> | |
349 | <ListItem><Para> | |
350 | This option defaults to on, use <literal/--no-list-cleanup/ to turn it | |
351 | off. When on <command/apt-get/ will automatically manage the contents of | |
352 | <filename>&statedir;/lists</> to ensure that obsolete files are erased. | |
353 | The only reason to turn it off is if you frequently change your source | |
354 | list. | |
355 | Configuration Item: <literal/APT::Get::List-Cleanup/. | |
356 | </VarListEntry> | |
357 | ||
358 | <VarListEntry><term><option/-t/</> | |
359 | <term><option/--target-release/</> | |
360 | <term><option/--default-release/</> | |
361 | <ListItem><Para> | |
362 | This option controls the default input to the policy engine, it creates | |
363 | a default pin at priority 990 using the specified release string. The | |
364 | preferences file may further override this setting. In short, this option | |
365 | lets you have simple control over which distribution packages will be | |
366 | retrieved from. Some common examples might me | |
367 | <option>-t '2.1*'</> or <option>-t unstable</>. | |
368 | Configuration Item: <literal/APT::Default-Release/ | |
369 | </VarListEntry> | |
370 | ||
371 | <VarListEntry><term><option/--trivial-only/</> | |
372 | <ListItem><Para> | |
373 | Only perform operations are 'trivial'. Logically this can be considered | |
374 | related to <option/--assume-yes/, where <option/--assume-yes/ will answer | |
375 | yes to any prompt, <option/--trivial-only/ will answer no. | |
376 | Configuration Item: <literal/APT::Get::Trivial-Only/. | |
377 | </VarListEntry> | |
378 | ||
379 | <VarListEntry><term><option/--no-remove/</> | |
380 | <ListItem><Para> | |
381 | If any packages are to be removed apt-get immediately aborts without | |
382 | prompting. | |
383 | Configuration Item: <literal/APT::Get::Remove/ | |
384 | </VarListEntry> | |
385 | ||
386 | <VarListEntry><term><option/--only-source/</> | |
387 | <ListItem><Para> | |
388 | Only has meaning for the <literal/source/ command. indicates that the | |
389 | given source names are not to be mapped through the binary table. | |
390 | Configuration Item: <literal/APT::Get::Only-Source/ | |
391 | </VarListEntry> | |
392 | ||
393 | <VarListEntry><term><option/--diff-only/</><term><option/--tar-only/</> | |
394 | <ListItem><Para> | |
395 | Download only the diff or tar file of a source archive. | |
396 | Configuration Item: <literal/APT::Get::Diff-Only/ and | |
397 | <literal/APT::Get::Tar-Only/ | |
398 | </VarListEntry> | |
399 | </VariableList> | |
400 | </RefSect1> | |
401 | ||
402 | <RefSect1><Title>Files</> | |
403 | <variablelist> | |
404 | <VarListEntry><term><filename>/etc/apt/sources.list</></term> | |
405 | <ListItem><Para> | |
406 | locations to fetch packages from. | |
407 | Configuration Item: <literal/Dir::Etc::SourceList/. | |
408 | </VarListEntry> | |
409 | ||
410 | <VarListEntry><term><filename>&cachedir;/archives/</></term> | |
411 | <ListItem><Para> | |
412 | storage area for retrieved package files | |
413 | Configuration Item: <literal/Dir::Cache::Archives/. | |
414 | </VarListEntry> | |
415 | ||
416 | <VarListEntry><term><filename>&cachedir;/archives/partial/</></term> | |
417 | <ListItem><Para> | |
418 | storage area for package files in transit | |
419 | Configuration Item: <literal/Dir::Cache::Archives/ (implicit partial). | |
420 | </VarListEntry> | |
421 | ||
422 | <VarListEntry><term><filename>&statedir;/lists/</></term> | |
423 | <ListItem><Para> | |
424 | storage area for state information for each package resource specified in | |
425 | &sources-list; | |
426 | Configuration Item: <literal/Dir::State::Lists/. | |
427 | </VarListEntry> | |
428 | ||
429 | <VarListEntry><term><filename>&statedir;/lists/partial/</></term> | |
430 | <ListItem><Para> | |
431 | storage area for state information in transit. | |
432 | Configuration Item: <literal/Dir::State::Lists/ (implicit partial). | |
433 | </VarListEntry> | |
434 | </variablelist> | |
435 | </RefSect1> | |
436 | ||
437 | <RefSect1><Title>See Also</> | |
438 | <para> | |
439 | &apt-cache;, &dpkg;, &dselect;, &sources-list;, &apt-conf;, The | |
440 | APT users guide in &docdir;. | |
441 | </RefSect1> | |
442 | ||
443 | <RefSect1><Title>Diagnostics</> | |
444 | <para> | |
445 | <command/apt-get/ returns zero on normal operation, decimal 100 on error. | |
446 | </RefSect1> | |
447 | ||
448 | &manbugs; | |
449 | &manauthor; | |
450 | ||
451 | </refentry> |