]>
Commit | Line | Data |
---|---|---|
de50f048 AL |
1 | mailto(apt@packages.debian.org) |
2 | manpage(apt-get)(8)(4 Dec 1998)(apt)() | |
3 | manpagename(apt-get)(APT package handling utility -- command-line interface) | |
4 | ||
5 | manpagesynopsis() | |
6 | apt-get [options] [command] [package ...] | |
7 | ||
8 | manpagedescription() | |
9 | ||
10 | apt-get is the command-line tool for handling packages, and may be considered | |
11 | the user's "back-end" to apt(8). | |
12 | ||
13 | em(command) is one of: | |
14 | itemize( | |
15 | it() update | |
16 | it() upgrade | |
17 | it() dselect-upgrade | |
18 | it() dist-upgrade | |
09f2e026 AL |
19 | it() install package1 [package2] [...] |
20 | it() remove package1 [package2] [...] | |
4994560c | 21 | it() source package1 [package2] [...] |
de50f048 AL |
22 | it() check |
23 | it() clean | |
b381f6ed | 24 | it() autoclean |
de50f048 AL |
25 | ) |
26 | ||
27 | Unless the -h, or --help option is given one of the above commands | |
09f2e026 | 28 | must be present. |
de50f048 AL |
29 | |
30 | startdit() | |
31 | dit(bf(update)) | |
32 | bf(update) is used to resynchronize the package overview files from their | |
33 | sources. The overviews of available packages are fetched from the | |
34 | location(s) specified in bf(/etc/apt/sources.list). | |
35 | For example, when using a Debian archive, this command retrieves and | |
36 | scans the bf(Packages.gz) files, so that information about new and updated | |
37 | packages is available. An bf(update) should always be performed before an | |
4994560c AL |
38 | bf(upgrade) bf(dist-upgrade). Please be aware that the overall progress |
39 | meter will be incorrect as the size of the package files cannot be known in | |
40 | advance. | |
de50f048 AL |
41 | |
42 | dit(bf(upgrade)) | |
43 | bf(upgrade) is used to install the newest versions of all packages currently | |
44 | installed on the system from the sources enumerated in | |
45 | bf(/etc/apt/sources.list). Packages currently installed with new versions | |
46 | available are retrieved and upgraded; under no circumstances are currently | |
47 | installed packages removed, or packages not already installed retrieved and | |
48 | installed. New versions of currently installed packages that cannot be | |
49 | upgraded without changing the install status of another package will be left | |
50 | at their current version. An bf(update) must be performed first so that | |
51 | bf(apt-get) knows that new versions of packages are available. | |
52 | ||
53 | dit(bf(dselect-upgrade)) | |
54 | bf(dselect-upgrade) | |
55 | is used in conjunction with the traditional Debian GNU/Linux packaging | |
56 | front-end, bf(dselect (8)). bf(dselect-upgrade) | |
57 | follows the changes made by bf(dselect) to the em(Status) | |
58 | field of available packages, and performs the actions necessary to realize | |
59 | that state (for instance, the removal of old and the installation of new | |
2c0c53b3 | 60 | packages). |
de50f048 AL |
61 | |
62 | dit(bf(dist-upgrade)) | |
63 | bf(dist-upgrade),in addition to performing the function of bf(upgrade), | |
64 | also intelligently handles changing dependencies with new versions of | |
65 | packages; bf(apt-get) has a "smart" conflict resolution system, and it will | |
66 | attempt to upgrade the most important packages at the expense of less | |
67 | important ones if necessary. The bf(/etc/apt/sources.list) file contains a | |
68 | list of locations from which to retrieve desired package files. | |
69 | ||
70 | dit(bf(install)) | |
71 | bf(install) is followed by one or more em(packages) desired for installation. | |
72 | Each em(package) is a package name, not a fully qualified filename | |
6d5dd02a | 73 | (for instance, in a Debian GNU/Linux system, em(ldso) would be the argument |
de50f048 AL |
74 | provided, not em(ldso_1.9.6-2.deb)). All packages required by the package(s) |
75 | specified for installation will also be retrieved and installed. The | |
76 | bf(/etc/apt/sources.list) file is used to locate the desired packages. If a | |
77 | hyphen is appended to the package name (with no intervening space), the | |
78 | identified package will be removed if it is installed. This latter feature | |
79 | may be used to override decisions made by apt-get's conflict resolution system. | |
80 | ||
c373c37a AL |
81 | If no package matches the given expression and the expression contains one |
82 | of '.', '?' or '*' then it is assumed to be a POSIX regex and it is applied | |
83 | to all package names in the database. Any matches are then installed (or | |
648e3cb4 AL |
84 | removed). Note that matching is done by substring so 'lo*' matches 'how-lo' |
85 | and 'lowest'. If this is undesired prefix with a '^' character. | |
c373c37a | 86 | |
09f2e026 AL |
87 | dit(bf(remove)) |
88 | bf(remove) is identical to bf(install) except that packages are removed | |
89 | instead of installed. If a plus sign is appended to the package name (with no | |
90 | intervening space), the identified package will be installed. | |
91 | ||
4994560c AL |
92 | dit(bf(source)) |
93 | bf(source) causes apt-get to fetch source packages. APT will examine the | |
94 | available packages to decide which source package to fetch. It will then | |
95 | find and download into the current directory the newest available version of | |
c1e78ee5 | 96 | that source package. Source packages are tracked separately from binary |
4a6a69b5 | 97 | packages via bf(deb-src) type lines in the bf(/etc/apt/sources.list) file. |
4994560c | 98 | This probably will mean that you will not get the same source as the package |
fb0ee66e AL |
99 | you have installed or as you could install. If the --compile options is |
100 | specified then the package will be compiled to a binary .deb using | |
101 | dpkg-buildpackage, if --download-only is specified then the source package | |
102 | will not be unpacked. | |
4994560c | 103 | |
d385e2e8 AL |
104 | Note that source packages are not tracked like binary packages, they exist |
105 | only in the current directory and are similar to downloading source | |
106 | tar balls. | |
107 | ||
de50f048 AL |
108 | dit(bf(check)) |
109 | bf(check) is a diagnostic tool; it updates the package cache and checks for | |
c1e78ee5 | 110 | broken packages. |
de50f048 AL |
111 | |
112 | dit(bf(clean)) | |
35c22def | 113 | bf(clean) clears out the local repository of retrieved package files. It |
de50f048 AL |
114 | removes everything but the lock file from bf(/var/cache/apt/archives/) |
115 | and bf(/var/cache/apt/archives/partial/). | |
116 | When APT is used as a bf(dselect(8)) method, bf(clean) is run automatically. | |
117 | Those who do not use dselect will likely want to run code(apt-get clean) | |
118 | from time to time to free up disk space. | |
b381f6ed AL |
119 | |
120 | dit(bf(autoclean)) | |
35c22def | 121 | Like bf(clean), bf(autoclean) clears out the local repository of retrieved |
b381f6ed AL |
122 | package files. The difference is that it only removes package files that |
123 | can no longer be downloaded, and are largely useless. This allows a | |
124 | cache to be maintained over a long period without it growing out of | |
125 | control. | |
126 | ||
de50f048 AL |
127 | enddit() |
128 | ||
129 | manpageoptions() | |
3d8fd174 AL |
130 | All command line options may be set using the configuration file, the |
131 | descriptions indicate the configuration option to set. For boolean | |
132 | options you can override the config file by using something like bf(-f-), | |
133 | bf(--no-f), bf(-f=no) or several other variations. | |
de50f048 AL |
134 | |
135 | startdit() | |
136 | dit(bf(-d, --download-only)) | |
137 | Download only; package files are only retrieved, not unpacked or installed. | |
83ab33fc | 138 | Configuration Item: bf(APT::Get::Download-Only). |
de50f048 AL |
139 | |
140 | dit(bf(-f, --fix-broken)) | |
141 | Fix; attempt to correct a system with broken dependencies in | |
142 | place. This option may be used alone or in conjunction with any of the | |
143 | command actions, and is sometimes necessary when running APT for the | |
144 | first time; APT itself does not allow broken package dependencies to | |
145 | exist on a system. It is possible that a system's dependency structure | |
146 | can be so corrupt as to require manual intervention (which usually | |
147 | means using dselect or dpkg --remove to eliminate some of the offending | |
148 | packages). Use of this option together with -m may produce an error in | |
83ab33fc | 149 | some situations. Configuration Item: bf(APT::Get::Fix-Broken). |
de50f048 AL |
150 | |
151 | dit(bf(-h, --help)) | |
152 | Help; display a helpful usage message and exits. | |
153 | ||
04aa15a8 | 154 | dit(bf(-v, --version)) |
c1e78ee5 | 155 | Show the program version. |
04aa15a8 | 156 | |
72f16ed2 | 157 | dit(bf(-m, --ignore-missing, --fix-missing)) |
de50f048 AL |
158 | Ignore missing packages; If packages cannot be retrieved or fail the |
159 | integrity check after retrieval (corrupted package files), hold back | |
160 | those packages and handle the result. Use of this option together with | |
a3eaf954 AL |
161 | -f may produce an error in some situations. If a package is selected for |
162 | installation (particularly if it is mentioned on the command line) and it | |
163 | could not be downloaded then it will be silently held back. | |
164 | Configuration Item: bf(APT::Get::ignore-missing). | |
de50f048 | 165 | |
ab559b35 AL |
166 | dit(bf(--no-download)) |
167 | Disables downloading of packages. This is best used with --ignore-missing to | |
168 | force APT to use only the .debs it has already downloaded. | |
a3eaf954 | 169 | Configuration Item: bf(APT::Get::No-Download). |
ab559b35 | 170 | |
09f2e026 | 171 | dit(bf(-q, --quiet)) |
de50f048 | 172 | Quiet; produces output suitable for logging, omitting progress indicators. |
c1e78ee5 | 173 | More q's will produce more quiet up to a maximum of 2. You can also use |
0c95c765 AL |
174 | bf(-q=#) to set the quiet level, overriding the configuration file. Note that |
175 | quiet level 2 implies -y, you should never use -qq without a no-action | |
176 | modifier such as -d, --print-uris or -s as APT may decided to do something | |
177 | you did not expect. | |
83ab33fc | 178 | Configuration Item: bf(quiet) |
de50f048 AL |
179 | |
180 | dit(bf(-s, --simulate, --just-print, --dry-run, --recon, --no-act)) | |
181 | No action; perform a simulation of events that would occur but do not | |
83ab33fc AL |
182 | actually change the system. Configuration Item: bf(APT::Get::Simulate). |
183 | ||
184 | Simulate prints out | |
5c2cb6e4 AL |
185 | a series of lines each one representing a dpkg operation, Configure (Conf), |
186 | Remove (Remv), Unpack (Inst). Square brackets indicate broken packages with | |
187 | and empty set of square brackets meaning breaks that are of no consequence | |
188 | (rare). | |
de50f048 AL |
189 | |
190 | dit(bf(-y, --yes, --assume-yes)) | |
191 | Automatic yes to prompts; assume "yes" as answer to all prompts and run | |
c1e78ee5 AL |
192 | non-interactively. If an undesirable situation, such as changing a held |
193 | package or removing an essential package occurs then bf(apt-get) will | |
83ab33fc | 194 | abort. Configuration Item: bf(APT::Get::Assume-Yes). |
de50f048 AL |
195 | |
196 | dit(bf(-u, --show-upgraded)) | |
197 | Show upgraded packages; Print out a list of all packages that are to be | |
83ab33fc | 198 | upgraded. Configuration Item: bf(APT::Get::Show-Upgraded). |
de50f048 | 199 | |
fb0ee66e AL |
200 | dit(bf(-b, --compile, --build)) |
201 | Compile source packages after downloading them. | |
a3eaf954 | 202 | Configuration Item: bf(APT::Get::Compile). |
fb0ee66e | 203 | |
de50f048 AL |
204 | dit(bf(--ignore-hold)) |
205 | Ignore package Holds; This causes bf(apt-get) to ignore a hold placed on | |
c1e78ee5 | 206 | a package. This may be useful in conjunction with bf(dist-upgrade) to |
83ab33fc | 207 | override a large number of undesired holds. Configuration Item: bf(APT::Ignore-Hold). |
de50f048 AL |
208 | |
209 | dit(bf(--no-upgrade)) | |
210 | Do not upgrade packages; When used in conjunction with bf(install) | |
211 | bf(no-upgrade) will prevent packages listed from being upgraded if they | |
83ab33fc | 212 | are already installed. Configuration Item: bf(APT::Get::no-upgrade). |
de50f048 AL |
213 | |
214 | dit(bf(--force-yes)) | |
215 | Force yes; This is a dangerous option that will cause apt to continue without | |
c1e78ee5 | 216 | prompting if it is doing something potentially harmful. It should not be used |
de50f048 | 217 | except in very special situations. Using bf(force-yes) can potentially destroy |
83ab33fc | 218 | your system! Configuration Item: bf(APT::Get::force-yes). |
de50f048 | 219 | |
f7a08e33 AL |
220 | dit(bf(--print-uris)) |
221 | Instead of fetching the files to install their URIs are printed. Each | |
222 | URI will have the path, the destination file name, the size and the expected | |
223 | md5 hash. Note that the file name to write to will not always match | |
4994560c | 224 | the file name on the remote site! This also works with the bf(source) |
83ab33fc | 225 | command. Configuration Item: bf(APT::Get::Print-URIs). |
f7a08e33 | 226 | |
fc4b5c9f AL |
227 | dit(bf(--purge)) |
228 | Use purge instead of remove for anything that would be removed. | |
a3eaf954 | 229 | Configuration Item: bf(APT::Get::Purge). |
fc4b5c9f | 230 | |
d0c59649 AL |
231 | dit(bf(--reinstall)) |
232 | Re-Install packages that are already installed and at the newest version. | |
233 | ||
9df71a5b AL |
234 | dit(bf(--list-cleanup)) |
235 | This option defaults to on, use bf(--no-list-cleanup) to turn it off. | |
236 | When on apt-get will automatically manage the contents of | |
237 | /var/state/apt/lists to ensure that obsolete files are erased. The only | |
83ab33fc AL |
238 | reason to turn it off is if you frequently change your source list. |
239 | Configuration Item: bf(APT::Get::List-Cleanup) | |
17c0e8e1 | 240 | |
d150b09d AL |
241 | dit(bf(--trivial-only)) |
242 | Only perform operations are 'trivial'. Logically this can be considered | |
243 | related to --assume-yes, where --assume-yes will answer yes to any prompt, | |
83ab33fc | 244 | --trivial-only will answer no. Configuration Item: bf(APT::Get::Trivial-Only) |
d150b09d AL |
245 | |
246 | dit(bf(--no-remove)) | |
247 | If any packages are to be removed apt-get immediately aborts without | |
83ab33fc | 248 | prompting. Configuration Item: bf(APT::Get::No-Remove) |
d150b09d | 249 | |
a3eaf954 | 250 | dit(bf(--diff-only), bf(--tar-only)) |
83ab33fc AL |
251 | Download only the diff or tar file of a source archive. |
252 | Configuration Item: bf(APT::Get::Diff-Only) | |
9df71a5b | 253 | |
de50f048 AL |
254 | dit(bf(-c, --config-file)) |
255 | Configuration File; Specify a configuration file to use. bf(apt-get) will | |
256 | read the default configuration file and then this configuration file. See | |
257 | bf(apt.conf(5)) for syntax information. | |
258 | ||
259 | dit(bf(-o, --option)) | |
c1e78ee5 | 260 | Set a Configuration Option; This will set an arbitrary configuration option. |
de50f048 AL |
261 | The syntax is |
262 | verb(-o Foo::Bar=bar) | |
09f2e026 | 263 | enddit() |
de50f048 AL |
264 | |
265 | manpagefiles() | |
266 | itemize( | |
267 | it() /etc/apt/sources.list | |
268 | locations to fetch packages from | |
269 | ||
270 | it() /var/cache/apt/archives/ | |
271 | storage area for retrieved package files | |
272 | ||
273 | it() /var/cache/apt/archives/partial/ | |
274 | storage area for package files in transit | |
275 | ||
276 | it() /var/state/apt/lists/ | |
277 | storage area for state information for each package resource specified in | |
2c0c53b3 | 278 | the source list |
de50f048 AL |
279 | |
280 | it() /var/state/apt/lists/partial/ | |
281 | storage area for state information in transit | |
282 | ) | |
283 | ||
284 | manpageseealso() | |
09f2e026 AL |
285 | apt-cache(8), |
286 | dpkg(8), | |
287 | dselect(8), | |
288 | sources.list(5), | |
3d8fd174 | 289 | apt.conf(5), |
09f2e026 | 290 | The APT Users Guide in /usr/doc/apt/ |
de50f048 AL |
291 | |
292 | manpagediagnostics() | |
293 | apt-get returns zero on normal operation, decimal 100 on error. | |
294 | ||
295 | manpagebugs() | |
d59cbe7f | 296 | See http://bugs.debian.org/apt. If you wish to report a |
de50f048 AL |
297 | bug in bf(apt-get), please see bf(/usr/doc/debian/bug-reporting.txt) |
298 | or the bf(bug(1)) command. | |
299 | ||
300 | manpageauthor() | |
301 | apt-get was written by the APT team <apt@packages.debian.org>. |