failure code if package files could not be downloaded
[ntk/apt.git] / doc / apt-get.8.yo
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
19 it() install package1 [package2] [...]
20 it() remove package1 [package2] [...]
21 it() source package1 [package2] [...]
22 it() check
23 it() clean
24 it() autoclean
25 )
26
27 Unless the -h, or --help option is given one of the above commands
28 must be present.
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
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.
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
60 packages).
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
73 (for instance, in a Debian GNU/Linux system, em(ldso) would be the argument
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
81 dit(bf(remove))
82 bf(remove) is identical to bf(install) except that packages are removed
83 instead of installed. If a plus sign is appended to the package name (with no
84 intervening space), the identified package will be installed.
85
86 dit(bf(source))
87 bf(source) causes apt-get to fetch source packages. APT will examine the
88 available packages to decide which source package to fetch. It will then
89 find and download into the current directory the newest available version of
90 that source package. Source packages are tracked separately from binary
91 packages via bf(deb-src) type lines in the bf(/etc/apt/sources.list) file.
92 This probably will mean that you will not get the same source as the package
93 you have installed or as you could install. If the --compile options is
94 specified then the package will be compiled to a binary .deb using
95 dpkg-buildpackage, if --download-only is specified then the source package
96 will not be unpacked.
97
98 dit(bf(check))
99 bf(check) is a diagnostic tool; it updates the package cache and checks for
100 broken packages.
101
102 dit(bf(clean))
103 bf(clean) clears out the local repository of retrieved package files. It
104 removes everything but the lock file from bf(/var/cache/apt/archives/)
105 and bf(/var/cache/apt/archives/partial/).
106 When APT is used as a bf(dselect(8)) method, bf(clean) is run automatically.
107 Those who do not use dselect will likely want to run code(apt-get clean)
108 from time to time to free up disk space.
109
110 dit(bf(autoclean))
111 Like bf(clean), bf(autoclean) clears out the local repository of retrieved
112 package files. The difference is that it only removes package files that
113 can no longer be downloaded, and are largely useless. This allows a
114 cache to be maintained over a long period without it growing out of
115 control.
116
117 enddit()
118
119 manpageoptions()
120 All command line options may be set using the configuration file, the
121 descriptions indicate the configuration option to set. For boolean
122 options you can override the config file by using something like bf(-f-),
123 bf(--no-f), bf(-f=no) or several other variations.
124
125 startdit()
126 dit(bf(-d, --download-only))
127 Download only; package files are only retrieved, not unpacked or installed.
128 See bf(APT::Get::Download-Only).
129
130 dit(bf(-f, --fix-broken))
131 Fix; attempt to correct a system with broken dependencies in
132 place. This option may be used alone or in conjunction with any of the
133 command actions, and is sometimes necessary when running APT for the
134 first time; APT itself does not allow broken package dependencies to
135 exist on a system. It is possible that a system's dependency structure
136 can be so corrupt as to require manual intervention (which usually
137 means using dselect or dpkg --remove to eliminate some of the offending
138 packages). Use of this option together with -m may produce an error in
139 some situations. See bf(APT::Get::Fix-Broken).
140
141 dit(bf(-h, --help))
142 Help; display a helpful usage message and exits.
143
144 dit(bf(-v, --version))
145 Show the program version.
146
147 dit(bf(-m, --ignore-missing, --fix-missing))
148 Ignore missing packages; If packages cannot be retrieved or fail the
149 integrity check after retrieval (corrupted package files), hold back
150 those packages and handle the result. Use of this option together with
151 -f may produce an error in some situations. See bf(ignore-missing).
152
153 dit(bf(--no-download))
154 Disables downloading of packages. This is best used with --ignore-missing to
155 force APT to use only the .debs it has already downloaded.
156
157 dit(bf(-q, --quiet))
158 Quiet; produces output suitable for logging, omitting progress indicators.
159 More q's will produce more quiet up to a maximum of 2. You can also use
160 bf(-q=#) to set the quiet level, overriding the configuration file. Note that
161 quiet level 2 implies -y, you should never use -qq without a no-action
162 modifier such as -d, --print-uris or -s as APT may decided to do something
163 you did not expect.
164 See bf(quiet)
165
166 dit(bf(-s, --simulate, --just-print, --dry-run, --recon, --no-act))
167 No action; perform a simulation of events that would occur but do not
168 actually change the system. See bf(APT::Get::Simulate). Simulate prints out
169 a series of lines each one representing a dpkg operation, Configure (Conf),
170 Remove (Remv), Unpack (Inst). Square brackets indicate broken packages with
171 and empty set of square brackets meaning breaks that are of no consequence
172 (rare).
173
174 dit(bf(-y, --yes, --assume-yes))
175 Automatic yes to prompts; assume "yes" as answer to all prompts and run
176 non-interactively. If an undesirable situation, such as changing a held
177 package or removing an essential package occurs then bf(apt-get) will
178 abort. See bf(APT::Get::Assume-Yes).
179
180 dit(bf(-u, --show-upgraded))
181 Show upgraded packages; Print out a list of all packages that are to be
182 upgraded. See bf(APT::Get::Show-Upgraded).
183
184 dit(bf(-b, --compile, --build))
185 Compile source packages after downloading them.
186
187 dit(bf(--ignore-hold))
188 Ignore package Holds; This causes bf(apt-get) to ignore a hold placed on
189 a package. This may be useful in conjunction with bf(dist-upgrade) to
190 override a large number of undesired holds. See bf(APT::Ignore-Hold).
191
192 dit(bf(--no-upgrade))
193 Do not upgrade packages; When used in conjunction with bf(install)
194 bf(no-upgrade) will prevent packages listed from being upgraded if they
195 are already installed. See bf(APT::Get::no-upgrade).
196
197 dit(bf(--force-yes))
198 Force yes; This is a dangerous option that will cause apt to continue without
199 prompting if it is doing something potentially harmful. It should not be used
200 except in very special situations. Using bf(force-yes) can potentially destroy
201 your system! See bf(APT::Get::force-yes).
202
203 dit(bf(--print-uris))
204 Instead of fetching the files to install their URIs are printed. Each
205 URI will have the path, the destination file name, the size and the expected
206 md5 hash. Note that the file name to write to will not always match
207 the file name on the remote site! This also works with the bf(source)
208 command See bf(APT::Get::Print-URIs).
209
210 dit(bf(--purge))
211 Use purge instead of remove for anything that would be removed.
212
213 dit(bf(--list-cleanup))
214 This option defaults to on, use bf(--no-list-cleanup) to turn it off.
215 When on apt-get will automatically manage the contents of
216 /var/state/apt/lists to ensure that obsolete files are erased. The only
217 reason to turn it off is if you frequently change your source list.
218
219 dit(bf(-c, --config-file))
220 Configuration File; Specify a configuration file to use. bf(apt-get) will
221 read the default configuration file and then this configuration file. See
222 bf(apt.conf(5)) for syntax information.
223
224 dit(bf(-o, --option))
225 Set a Configuration Option; This will set an arbitrary configuration option.
226 The syntax is
227 verb(-o Foo::Bar=bar)
228 enddit()
229
230 manpagefiles()
231 itemize(
232 it() /etc/apt/sources.list
233 locations to fetch packages from
234
235 it() /var/cache/apt/archives/
236 storage area for retrieved package files
237
238 it() /var/cache/apt/archives/partial/
239 storage area for package files in transit
240
241 it() /var/state/apt/lists/
242 storage area for state information for each package resource specified in
243 the source list
244
245 it() /var/state/apt/lists/partial/
246 storage area for state information in transit
247 )
248
249 manpageseealso()
250 apt-cache(8),
251 dpkg(8),
252 dselect(8),
253 sources.list(5),
254 apt.conf(5),
255 The APT Users Guide in /usr/doc/apt/
256
257 manpagediagnostics()
258 apt-get returns zero on normal operation, decimal 100 on error.
259
260 manpagebugs()
261 See http://bugs.debian.org/apt. If you wish to report a
262 bug in bf(apt-get), please see bf(/usr/doc/debian/bug-reporting.txt)
263 or the bf(bug(1)) command.
264
265 manpageauthor()
266 apt-get was written by the APT team <apt@packages.debian.org>.