1APT-GET(8) APT-GET(8)
2
3
4
6 apt-get - APT package handling utility -- command-line interface
7
9 apt-get [ -hvs ] [ -o=config string ] [ -c=file ] { update | upgrade |
10 dselect-upgrade | install pkg ... | remove pkg ... | source pkg ...
11 | build-dep pkg ... | check | clean | autoclean }
12
13
15 apt-get is the command-line tool for handling packages, and may be con‐
16 sidered the user's "back-end" to other tools using the APT library.
17 Several "front-end" interfaces exist, such as dselect(8), aptitude,
18 synaptic, gnome-apt and wajig.
19
20 Unless the -h, or --help option is given, one of the commands below
21 must be present.
22
23 update update is used to resynchronize the package index files from
24 their sources. The indexes of available packages are fetched
25 from the location(s) specified in /etc/apt/sources.list. For
26 example, when using a Debian archive, this command retrieves and
27 scans the Packages.gz files, so that information about new and
28 updated packages is available. An update should always be per‐
29 formed before an upgrade or dist-upgrade. Please be aware that
30 the overall progress meter will be incorrect as the size of the
31 package files cannot be known in advance.
32
33 upgrade
34 upgrade is used to install the newest versions of all packages
35 currently installed on the system from the sources enumerated in
36 /etc/apt/sources.list. Packages currently installed with new
37 versions available are retrieved and upgraded; under no circum‐
38 stances are currently installed packages removed, or packages
39 not already installed retrieved and installed. New versions of
40 currently installed packages that cannot be upgraded without
41 changing the install status of another package will be left at
42 their current version. An update must be performed first so that
43 apt-get knows that new versions of packages are available.
44
45 dselect-upgrade
46 dselect-upgrade is used in conjunction with the traditional
47 Debian packaging front-end, dselect(8). dselect-upgrade follows
48 the changes made by dselect(8) to the Status field of available
49 packages, and performs the actions necessary to realize that
50 state (for instance, the removal of old and the installation of
51 new packages).
52
53 dist-upgrade
54 dist-upgrade, in addition to performing the function of upgrade,
55 also intelligently handles changing dependencies with new ver‐
56 sions of packages; apt-get has a "smart" conflict resolution
57 system, and it will attempt to upgrade the most important pack‐
58 ages at the expense of less important ones if necessary. The
59 /etc/apt/sources.list file contains a list of locations from
60 which to retrieve desired package files. See also apt_prefer‐
61 ences(5) for a mechanism for overriding the general settings for
62 individual packages.
63
64 install
65 install is followed by one or more packages desired for instal‐
66 lation. Each package is a package name, not a fully qualified
67 filename (for instance, in a Debian GNU/Linux system, libc6
68 would be the argument provided, not libc6_1.9.6-2.deb). All
69 packages required by the package(s) specified for installation
70 will also be retrieved and installed. The /etc/apt/sources.list
71 file is used to locate the desired packages. If a hyphen is
72 appended to the package name (with no intervening space), the
73 identified package will be removed if it is installed. Similarly
74 a plus sign can be used to designate a package to install. These
75 latter features may be used to override decisions made by apt-
76 get's conflict resolution system.
77
78 A specific version of a package can be selected for installation
79 by following the package name with an equals and the version of
80 the package to select. This will cause that version to be
81 located and selected for install. Alternatively a specific dis‐
82 tribution can be selected by following the package name with a
83 slash and the version of the distribution or the Archive name
84 (stable, testing, unstable).
85
86 Both of the version selection mechanisms can downgrade packages
87 and must be used with care.
88
89 Finally, the apt_preferences(5) mechanism allows you to create
90 an alternative installation policy for individual packages.
91
92 If no package matches the given expression and the expression
93 contains one of '.', '?' or '*' then it is assumed to be a POSIX
94 regular expression, and it is applied to all package names in
95 the database. Any matches are then installed (or removed). Note
96 that matching is done by substring so 'lo.*' matches 'how-lo'
97 and 'lowest'. If this is undesired, anchor the regular expres‐
98 sion with a '^' or '$' character, or create a more specific reg‐
99 ular expression.
100
101 remove remove is identical to install except that packages are removed
102 instead of installed. If a plus sign is appended to the package
103 name (with no intervening space), the identified package will be
104 installed instead of removed.
105
106 source source causes apt-get to fetch source packages. APT will examine
107 the available packages to decide which source package to fetch.
108 It will then find and download into the current directory the
109 newest available version of that source package. Source packages
110 are tracked separately from binary packages via deb-src type
111 lines in the sources.list(5) file. This probably will mean that
112 you will not get the same source as the package you have
113 installed or as you could install. If the --compile options is
114 specified then the package will be compiled to a binary .deb
115 using dpkg-buildpackage, if --download-only is specified then
116 the source package will not be unpacked.
117
118 A specific source version can be retrieved by postfixing the
119 source name with an equals and then the version to fetch, simi‐
120 lar to the mechanism used for the package files. This enables
121 exact matching of the source package name and version, implic‐
122 itly enabling the APT::Get::Only-Source option.
123
124 Note that source packages are not tracked like binary packages,
125 they exist only in the current directory and are similar to
126 downloading source tar balls.
127
128 build-dep
129 build-dep causes apt-get to install/remove packages in an
130 attempt to satisfy the build dependencies for a source package.
131
132 check check is a diagnostic tool; it updates the package cache and
133 checks for broken dependencies.
134
135 clean clean clears out the local repository of retrieved package
136 files. It removes everything but the lock file from
137 /var/cache/apt/archives/ and /var/cache/apt/archives/partial/.
138 When APT is used as a dselect(8) method, clean is run automati‐
139 cally. Those who do not use dselect will likely want to run
140 apt-get clean from time to time to free up disk space.
141
142 autoclean
143 Like clean, autoclean clears out the local repository of
144 retrieved package files. The difference is that it only removes
145 package files that can no longer be downloaded, and are largely
146 useless. This allows a cache to be maintained over a long period
147 without it growing out of control. The configuration option
148 APT::Clean-Installed will prevent installed packages from being
149 erased if it is set to off.
150
152 All command line options may be set using the configuration file, the
153 descriptions indicate the configuration option to set. For boolean
154 options you can override the config file by using something like
155 -f-,--no-f, -f=no or several other variations.
156
157 -d
158
159 --download-only
160 Download only; package files are only retrieved, not unpacked or
161 installed. Configuration Item: APT::Get::Download-Only.
162
163 -f
164
165 --fix-broken
166 Fix; attempt to correct a system with broken dependencies in
167 place. This option, when used with install/remove, can omit any
168 packages to permit APT to deduce a likely solution. Any Package
169 that are specified must completely correct the problem. The
170 option is sometimes necessary when running APT for the first
171 time; APT itself does not allow broken package dependencies to
172 exist on a system. It is possible that a system's dependency
173 structure can be so corrupt as to require manual intervention
174 (which usually means using dselect(8) or dpkg --remove to elimi‐
175 nate some of the offending packages). Use of this option
176 together with -m may produce an error in some situations. Con‐
177 figuration Item: APT::Get::Fix-Broken.
178
179 -m
180
181 --ignore-missing
182
183 --fix-missing
184 Ignore missing packages; If packages cannot be retrieved or fail
185 the integrity check after retrieval (corrupted package files),
186 hold back those packages and handle the result. Use of this
187 option together with -f may produce an error in some situations.
188 If a package is selected for installation (particularly if it is
189 mentioned on the command line) and it could not be downloaded
190 then it will be silently held back. Configuration Item:
191 APT::Get::Fix-Missing.
192
193 --no-download
194 Disables downloading of packages. This is best used with
195 --ignore-missing to force APT to use only the .debs it has
196 already downloaded. Configuration Item: APT::Get::Download.
197
198 -q
199
200 --quiet
201 Quiet; produces output suitable for logging, omitting progress
202 indicators. More q's will produce more quiet up to a maximum of
203 2. You can also use -q=# to set the quiet level, overriding the
204 configuration file. Note that quiet level 2 implies -y, you
205 should never use -qq without a no-action modifier such as -d,
206 --print-uris or -s as APT may decided to do something you did
207 not expect. Configuration Item: quiet.
208
209 -s
210
211 --simulate
212
213 --just-print
214
215 --dry-run
216
217 --recon
218
219 --no-act
220 No action; perform a simulation of events that would occur but
221 do not actually change the system. Configuration Item:
222 APT::Get::Simulate.
223
224 Simulate prints out a series of lines each one representing a
225 dpkg operation, Configure (Conf), Remove (Remv), Unpack (Inst).
226 Square brackets indicate broken packages with and empty set of
227 square brackets meaning breaks that are of no consequence
228 (rare).
229
230 -y
231
232 --yes
233
234 --assume-yes
235 Automatic yes to prompts; assume "yes" as answer to all prompts
236 and run non-interactively. If an undesirable situation, such as
237 changing a held package or removing an essential package occurs
238 then apt-get will abort. Configuration Item: APT::Get::Assume-
239 Yes.
240
241 -u
242
243 --show-upgraded
244 Show upgraded packages; Print out a list of all packages that
245 are to be upgraded. Configuration Item: APT::Get::Show-
246 Upgraded.
247
248 -V
249
250 --verbose-versions
251 Show full versions for upgraded and installed packages. Config‐
252 uration Item: APT::Get::Show-Versions.
253
254 -b
255
256 --compile
257
258 --build
259 Compile source packages after downloading them. Configuration
260 Item: APT::Get::Compile.
261
262 --ignore-hold
263 Ignore package Holds; This causes apt-get to ignore a hold
264 placed on a package. This may be useful in conjunction with
265 dist-upgrade to override a large number of undesired holds.
266 Configuration Item: APT::Ignore-Hold.
267
268 --no-upgrade
269 Do not upgrade packages; When used in conjunction with install
270 no-upgrade will prevent packages listed from being upgraded if
271 they are already installed. Configuration Item:
272 APT::Get::Upgrade.
273
274 --force-yes
275 Force yes; This is a dangerous option that will cause apt to
276 continue without prompting if it is doing something potentially
277 harmful. It should not be used except in very special situa‐
278 tions. Using force-yes can potentially destroy your system!
279 Configuration Item: APT::Get::force-yes.
280
281 --print-uris
282 Instead of fetching the files to install their URIs are printed.
283 Each URI will have the path, the destination file name, the size
284 and the expected md5 hash. Note that the file name to write to
285 will not always match the file name on the remote site! This
286 also works with the source and update commands. When used with
287 the update command the MD5 and size are not included, and it is
288 up to the user to decompress any compressed files. Configura‐
289 tion Item: APT::Get::Print-URIs.
290
291 --purge
292 Use purge instead of remove for anything that would be removed.
293 An asterisk ("*") will be displayed next to packages which are
294 scheduled to be purged. Configuration Item: APT::Get::Purge.
295
296 --reinstall
297 Re-Install packages that are already installed and at the newest
298 version. Configuration Item: APT::Get::ReInstall.
299
300 --list-cleanup
301 This option defaults to on, use --no-list-cleanup to turn it
302 off. When on apt-get will automatically manage the contents of
303 /var/lib/apt/lists to ensure that obsolete files are erased.
304 The only reason to turn it off is if you frequently change your
305 source list. Configuration Item: APT::Get::List-Cleanup.
306
307 -t
308
309 --target-release
310
311 --default-release
312 This option controls the default input to the policy engine, it
313 creates a default pin at priority 990 using the specified
314 release string. The preferences file may further override this
315 setting. In short, this option lets you have simple control over
316 which distribution packages will be retrieved from. Some common
317 examples might be -t '2.1*' or -t unstable. Configuration Item:
318 APT::Default-Release; see also the apt_preferences(5) manual
319 page.
320
321 --trivial-only
322 Only perform operations that are 'trivial'. Logically this can
323 be considered related to --assume-yes, where --assume-yes will
324 answer yes to any prompt, --trivial-only will answer no. Con‐
325 figuration Item: APT::Get::Trivial-Only.
326
327 --no-remove
328 If any packages are to be removed apt-get immediately aborts
329 without prompting. Configuration Item: APT::Get::Remove
330
331 --only-source
332 Only has meaning for the source command. Indicates that the
333 given source names are not to be mapped through the binary ta‐
334 ble. This means that if this option is specified, the source
335 command will only accept source package names as arguments,
336 rather than accepting binary package names and looking up the
337 corresponding source package. Configuration Item:
338 APT::Get::Only-Source
339
340 --diff-only
341
342 --tar-only
343 Download only the diff or tar file of a source archive. Config‐
344 uration Item: APT::Get::Diff-Only and APT::Get::Tar-Only
345
346 --arch-only
347 Only process architecture-dependent build-dependencies. Config‐
348 uration Item: APT::Get::Arch-Only
349
350 -h
351
352 --help Show a short usage summary.
353
354 -v
355
356 --version
357 Show the program version.
358
359 -c
360
361 --config-file
362 Configuration File; Specify a configuration file to use. The
363 program will read the default configuration file and then this
364 configuration file. See apt.conf(5) for syntax information.
365
366 -o
367
368 --option
369 Set a Configuration Option; This will set an arbitrary configu‐
370 ration option. The syntax is -o Foo::Bar=bar.
371
373 /etc/apt/sources.list
374 Locations to fetch packages from. Configuration Item:
375 Dir::Etc::SourceList.
376
377 /etc/apt/apt.conf
378 APT configuration file. Configuration Item: Dir::Etc::Main.
379
380 /etc/apt/apt.conf.d/
381 APT configuration file fragments Configuration Item:
382 Dir::Etc::Parts.
383
384 /etc/apt/preferences
385 Version preferences file. This is where you would specify "pin‐
386 ning", i.e. a preference to get certain packages from a separate
387 source or from a different version of a distribution. Configu‐
388 ration Item: Dir::Etc::Preferences.
389
390 /var/cache/apt/archives/
391 Storage area for retrieved package files. Configuration Item:
392 Dir::Cache::Archives.
393
394 /var/cache/apt/archives/partial/
395 Storage area for package files in transit. Configuration Item:
396 Dir::Cache::Archives (implicit partial).
397
398 /var/lib/apt/lists/
399 Storage area for state information for each package resource
400 specified in sources.list(5) Configuration Item:
401 Dir::State::Lists.
402
403 /var/lib/apt/lists/partial/
404 Storage area for state information in transit. Configuration
405 Item: Dir::State::Lists (implicit partial).
406
408 apt-cache(8), apt-cdrom(8), dpkg(8), dselect(8), sources.list(5),
409 apt.conf(5), apt-config(8), The APT User's guide in
410 /usr/share/doc/apt-0.5.15lorg3.2/, apt_preferences(5), the APT Howto.
411
413 apt-get returns zero on normal operation, decimal 100 on error.
414
416 See the APT bug page <URL:http://bugs.debian.org/src:apt>. If you wish
417 to report a bug in APT, please see /usr/share/doc/debian/bug-report‐
418 ing.txt or the reportbug(1) command.
419
421 APT was written by the APT team <apt@packages.debian.org>.
422
423
424
425 02 August 2007 APT-GET(8)