forked from rickysarraf/apt-offline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
apt-offline.8
317 lines (229 loc) · 11.1 KB
/
apt-offline.8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
.TH apt-offline 8 "December 30, 2019" "version 1.8.2" "USER COMMANDS"
.SH NAME
apt-offline \- Offline APT Package manager
.SH SYNOPSIS
.B apt-offline
[ARGUMENTS] [OPTIONS]
.SH DESCRIPTION
apt-offline brings
offline package management functionality to Debian based system. It can be
used to download packages and its dependencies to be installed later on (or
required to update) a disconnected machine. Packages can be downloaded from a
different connected machine.
.PP
It can also fetch bug reports for the packages that are downloaded.
.PP
Unless the \-h/\-v or \-\-help/\-\-version options are given, one of the
.B get, set
or
.B install
commands must be provided.
.SS set FILENAME [-h] [--install-packages PKG...PKG_N] [--install-src-packages PKG...PKG_N] --src-build-dep [--release release_name] [--update] [--upgrade] [--upgrade-type upgrade]
.PP
.B set
generates a signature file with the data required to install on or update the
disconnected machine.
.B FILENAME {apt-offline.sig}
is the signature file generated on the machine. This file will contain all the
information necessary for apt.
.TP
\-\-simulate
Developer only. Used for testing.
.IP "\fB\-\-install\-packages [PKG...PKG_N]\fP" 10
Packages that need to be installed
.IP "\fB\-\-install\-src\-packages [PKG...PKG_N]\fP" 10
Source packages that need to be installed
.IP "\fB\-\-src\-build\-dep\fP" 10
Download Build Dependency packages for the source packages requested
.IP "\fB\-\-release release_name\fP" 10
Release target to install packages from
.IP "\fB\-\-apt\-backend apt-get\fP" 10
APT backend to use. One of: apt, apt-get, python-apt
.IP "\fB\-\-generate\-changelog\fP" 10
Generate changelog of the version to be downloaded
.IP "\fB\-\-update\fP" 10
Generate APT Database signature for an update. This is the equivalent of using
.B "apt-get update"
.IP "\fB\-\-upgrade\fP" 10
Generate APT Database signature for package upgrade. This is the equivalent of using
.B "apt-get upgrade"
.IP "\fB\-\-upgrade\-type {upgrade_type}\fP" 10
Type of upgrade you would like to perform. Default is
.B "upgrade".
Other valid types are
.B "dist-upgrade" and "dselect-upgrade"
.IP Note:
If neither of the
.B \-\-update or \-\-upgrade
option is explicitly mentioned, the
.B set
command will generate signature for both the \-\-update and \-\-upgrade options.
.SS get FILENAME [-h] [--socket-timeout ] [-d / --download-dir] [-s / --cache-dir] [--no-checksum] [-t / --threads ] [--bundle] [--bug-reports] [--proxy-host] [--proxy-port] [--https-cert-file --https-key-file] [--http-basicauth] [--disable-cert-check]
.PP
.B get
downloads APT data as per a signature file.
.B FILENAME {apt-offline.sig}
is the signature file required for details about data to be downloaded. This
file should have been generated by the above
.B set
command.
.IP "\fB\-d, \-\-download\-dir DIR_NAME\fP" 10
Download data to the specified DIR_NAME folder. If no folder name is specified, data is downloaded to a folder in the TEMPDIR path in the format
.B apt-offline-download-$PID
.IP "\fB\-s, \-\-cache\-dir DIR_NAME\fP" 10
Look for data in the cache before downloading it from the internet. If you are on a Debian box, you would want to specify
.I /var/cache/apt/archives
here. If the data is not available in the cache, the downloaded data is also copied to the cache.
.IP "\fB\-\-no\-checksum\fP" 10
Enabling this option will bypass the checksum verification of each downloaded file thus losing integrity of the package. Usage of this option is highly discouraged
.IP "\fB\-t, \-\-threads NUM_OF_THREADS\fP" 10
Number of threads to spawn for downloads. Default is 1. Using too many threads can overload the servers, hence it is advisable to keep the number low
.IP "\fB\-\-bundle FILENAME\fP" 10
Create an archive file FILENAME. The file is archived in zip format
.IP "\fB\-\-bug\-reports\fP" 10
Download bug reports for packages that are being downloaded. Currently only
the Debian BTS is supported.
.IP "\fB\-\-proxy\-host\fP" 10
Specify the Proxy Host to be used.
.IP "\fB\-\-proxy\-port\fP" 10
Specify the Proxy port number to be used.
.IP "\fB\-\-https\-cert\-file FILENAME\fP" 10
The Certificate-file to use if https-client-authentication is required on one or multiple hosts.
.IP "\fB\-\-https\-key\-file FILENAME\fP" 10
The Certificate-key-file to use if https-client-authentication is required on one or multiple hosts.
.IP "\fB\-\-disable-cert-check\fP" 10
Disable the check of https certificates on servers
.IP "\fB\-\-http\-basicauth URL\fP" 10
A username/password encoded in the URL. Note\: Passwords with special characters should be percent encoded as per RFC-3986 section 2.1
.SS install FILE/FOLDER [-h] [--skip-bug-reports ] [--install-src-path PATH] [--allow-unauthenticated]
.PP
.B install
installs APT data to the APT package database and updates it.
.B FILE {archive_bundle_file}
Install data from the archive (bundle) file.
.B FOLDER {/folder/path}
Install data from the folder path.
Either FILE or FOLDER argument can be provided to the
.B install
command.
.TP
\-\-simulate
Developer only. Used for testing.
.IP "\fB\-\-skip\-bug\-reports\fP" 10
Skip listing of downloaded bug reports, if any.
.IP "\fB\-\-skip\-changelog\fP" 10
Skip display of changelog, if any.
.IP "\fB\-\-allow\-unauthenticated\fP" 10
Don't verify GPG signatures for the data to be installed to APT. Usage of this option is highly discouraged.
.IP "\fB\-\-strict\-deb\-check\fP" 10
With this option enabled, apt-offline delegate's .deb package checksum validation to apt. While the .debs are
already available, they are stored in the temporary apt cache, where apt validates its checksum, before considering
it for further processing.
Note: This does have the caveat that apt may need network availability even though it doesn't download anything over the network. But it does invoke the download routines and realizes that the payload is already available. It then further proceeds with checksum validation
The default behavior is to
.B not
do strict checksum validation for .deb files. Instead, apt-offline copies the .deb files to apt's download location. apt still does size validation of the available .deb files and discards them in case there is a mismatch.
.IP "\fB\-\-install\-src\-path PATH\fP" 10
Path to filesystem where we want the source packages to be installed to. Default will be a folder in your TEMPDIR.
.SH GLOBAL OPTIONS
.TP
\-h, \-\-help
Show help message
.TP
\-\-verbose
Run in verbose mode
.TP
\-v, \-\-version
Display the version of the program
.SH EXAMPLES
.TP
.B NOTE: argument/option handling
apt\-offline relies on argparse for argument/option parsing. To explicitly instruct apt\-offline about an argument, you can pass it with the \-\- delimiter.
.B Ex. apt\-offline set \-\-update \-\-upgrade \-\-install\-packages wm2 \-\- foo.sig
By specifying the
.B \-\-
delimiter, we instruct apt\-offline that foo.sig is an argument to the
.B apt\-offline
command and not to the
.B \-\-install\-packages
option.
Otherwise, you could also use it positionally next to the set command
.B Ex. apt\-offline set foo.sig \-\-update \-\-upgrade \-\-install\-packages wm2
.TP
.B apt-offline set FILENAME
This command will generate a signature file FILENAME for APT Package Database.
To generate only the signature for updates, use the \-\-update option. To
generate only the signature for package upgrades, use the \-\-upgrade option.
Default behavior when no options are specified is to generate a signature for
both the operations.
.TP
.B apt-offline get FILENAME
This command will fetch the data required for APT Package Database as per the
signature file FILENAME generated by
.B apt-offline get.
To download bug reports also use the \-\-bug\-reports option. Currently supported bug tracker is Debian BTS only.
By default, if neither of \-d or \-\-bundle options are specified, apt-offline downloads data into a folder inside the TEMPDIR environment folder in the format apt\-offline\-downloads\-PID, where PID is the PID of the running apt\-offline process. Example on a Linux machine would be something like: /tmp/apt-offline-downloads-23242/
.TP
.B apt-offline install FILE|FOLDER
This command will sync the data downloaded by
.B apt-offline get
to the APT Package Database and update it.
Depending on where the data was downloaded to or packed into, either the
absolute FOLDER path or the archive FILE path can be specified.
.B NOTE1:
On a freshly installed box, that was installed without the network, the package database is null. In that case, you first need to run
.B apt-offline
with just the
.B \-\-update
option to ensure you have a meaningful package database
.B Example: apt-offline set set.uris \-\-update
.B NOTE2:
On a fresh setup installed through CD/DVD, the default APT setting lists only the install media URLs. In such case, you need to add the default APT network repositories to the list. For example, for a fresh (DVD) installed Debian box, add the relevant repository to
.I /etc/apt/sources.list.d/apt-offline.list or /etc/apt/sources.list
deb https://deb.debian.org/debian stable main contrib
.B (For Debian Stable)
deb https://deb.debian.org/debian unstable main contrib
.B (For Debian Unstable/Sid)
deb https://deb.debian.org/debian stretch main contrib
.B (For Debian Stretch)
deb http://security.debian.org stable/updates main contrib
.B (Security Updates for Debian Stable)
deb http://security.debian.org testing-security/updates main contrib
.B (Security Updates for Debian Testing)
.TP
Sequence 1: The following set of commands, when run in sequence, will update a disconnected machine.
.B apt-offline set update.sig \-\-update
(Generate the required data needed to update the APT database. Should be run on the disconnected machine)
.B apt-offline get update.sig \-\-bundle update.zip
(Download the required data needed to update the APT database. Should be run on a machine with internet connectivity)
.B apt-offline install update.zip
(Installs the data needed to update the APT database. Should be run on the disconnected machine)
.TP
Sequence 2: With successful completion of Sequence 1, the APT database on the disconnected machine will be up\-to\-date. Now, the following set of commands, when run in sequence, will upgrade a disconnected machine.
.B apt-offline set upgrade.sig \-\-upgrade
(Generate the required data needed to upgrade the upgradable packages. Should be run on the disconnected machine)
.B apt-offline get upgrade.sig \-\-bundle upgrade.zip
(Download the required data needed to upgrade the upgradable packages. Should be run on a machine with internet connectivity)
.B apt-offline install upgrade.zip
(Installs the data needed to upgrade the upgradable packages. Should be run on the disconnected machine)
.TP
After successful completion of
.B Sequence 1
and
.B Sequence 2
in order, further running
.B apt-get upgrade
will result in 0 bytes of additional download.
.SH AUTHOR
.B apt-offline is written by Ritesh Raj Sarraf ([email protected])
If you wish to report a bug in apt-offline, please see
.B https://github.com/rickysarraf/apt-offline
or else, send an email to me at
.SH SEE ALSO
apt-get(8),
apt-cache(8),
dpkg(8),
aptitude(8),
.SH DEDICATION
This software is dedicated to the memory of my father Santosh Kumar Sarraf. We miss you a lot.