apt-offline - Offline APT Package manager
Contents
Dedication
This software is dedicated to the memory of my father Santosh Kumar Sarraf. We miss you a lot.
version 1.8.6 February 08, 2025 apt-offline(8)
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.
It can also fetch bug reports for the packages that are downloaded.
Unless the -h/-v or --help/--version options are given, one of the get,set or install commands must be
provided.
setFILENAME[-h][--install-packagesPKG...PKG_N][--install-src-packagesPKG...PKG_N]--src-build-dep[--releaserelease_name][--update][--upgrade][--upgrade-typeupgrade]set generates a signature file with the data required to install on or update the disconnected machine.
FILENAME{apt-offline.sig} is the signature file generated on the machine. This file will contain all the
information necessary for apt.
--simulate
Developer only. Used for testing.
--install-packages[PKG...PKG_N]
Packages that need to be installed
--install-src-packages[PKG...PKG_N]
Source packages that need to be installed
--src-build-dep
Download Build Dependency packages for the source packages requested
--releaserelease_name
Release target to install packages from
--apt-backendapt-get
APT backend to use. One of: apt, apt-get, python-apt
--generate-changelog
Generate changelog of the version to be downloaded
--update Generate APT Database signature for an update. This is the equivalent of using apt-getupdate--upgrade Generate APT Database signature for package upgrade. This is the equivalent of using apt-getupgrade--upgrade-type{upgrade_type}
Type of upgrade you would like to perform. Default is upgrade. Other valid types are dist-upgradeanddselect-upgradegetFILENAME[-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]get downloads APT data as per a signature file.
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 set command.
-d,--download-dirDIR_NAME
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 apt-offline-download-$PID-s,--cache-dirDIR_NAME
Look for data in the cache before downloading it from the internet. If you are on a Debian box,
you would want to specify /var/cache/apt/archives here. If the data is not available in the
cache, the downloaded data is also copied to the cache.
--no-checksum
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
-t,--threadsNUM_OF_THREADS
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
--bundleFILENAME
Create an archive file FILENAME. The file is archived in zip format
--bug-reports
Download bug reports for packages that are being downloaded. Currently only the Debian BTS is
supported.
--proxy-host
Specify the Proxy Host to be used.
--proxy-port
Specify the Proxy port number to be used.
--https-cert-fileFILENAME
The Certificate-file to use if https-client-authentication is required on one or multiple
hosts.
--https-key-fileFILENAME
The Certificate-key-file to use if https-client-authentication is required on one or multiple
hosts.
--disable-cert-check
Disable the check of https certificates on servers
--http-basicauthURL
A username/password encoded in the URL. Note Passwords with special characters should be
percent encoded as per RFC-3986 section 2.1
installFILE/FOLDER[-h][--skip-bug-reports][--install-src-pathPATH][--allow-unauthenticated]install installs APT data to the APT package database and updates it.
FILE{archive_bundle_file} Install data from the archive (bundle) file.
FOLDER{/folder/path} Install data from the folder path.
Either FILE or FOLDER argument can be provided to the install command.
--simulate
Developer only. Used for testing.
--skip-bug-reports
Skip listing of downloaded bug reports, if any.
--skip-changelog
Skip display of changelog, if any.
--allow-unauthenticated
Don't verify GPG signatures for the data to be installed to APT. Usage of this option is highly
discouraged.
--strict-deb-check
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 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.
--install-src-pathPATH
Path to filesystem where we want the source packages to be installed to. Default will be a
folder in your TEMPDIR.
Examples
NOTE:argument/optionhandling
apt-offline relies on argparse for argument/option parsing. To explicitly instruct apt-offline
about an argument, you can pass it with the -- delimiter.
Ex.apt-offlineset--update--upgrade--install-packageswm2--foo.sig
By specifying the -- delimiter, we instruct apt-offline that foo.sig is an argument to the
apt-offline command and not to the --install-packages option.
Otherwise, you could also use it positionally next to the set command
Ex.apt-offlinesetfoo.sig--update--upgrade--install-packageswm2apt-offlinesetFILENAME
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.
apt-offlinegetFILENAME
This command will fetch the data required for APT Package Database as per the signature file
FILENAME generated by apt-offlineget. 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/
apt-offlineinstallFILE|FOLDER
This command will sync the data downloaded by apt-offlineget 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.
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 apt-offline with just the --update option to ensure you
have a meaningful package database
Example:apt-offlinesetset.uris--updateNOTE2: 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
/etc/apt/sources.list.d/apt-offline.listor/etc/apt/sources.list
deb https://deb.debian.org/debian stable main contrib
(ForDebianStable)
deb https://deb.debian.org/debian unstable main contrib
(ForDebianUnstable/Sid)
deb https://deb.debian.org/debian stretch main contrib
(ForDebianStretch)
deb http://security.debian.org stable/updates main contrib
(SecurityUpdatesforDebianStable)
deb http://security.debian.org testing-security/updates main contrib
(SecurityUpdatesforDebianTesting)
Sequence 1: The following set of commands, when run in sequence, will update a disconnected machine.
apt-offlinesetupdate.sig--update
(Generate the required data needed to update the APT database. Should be run on the disconnected
machine)
apt-offlinegetupdate.sig--bundleupdate.zip
(Download the required data needed to update the APT database. Should be run on a machine with
internet connectivity)
apt-offlineinstallupdate.zip
(Installs the data needed to update the APT database. Should be run on the disconnected machine)
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.
apt-offlinesetupgrade.sig--upgrade
(Generate the required data needed to upgrade the upgradable packages. Should be run on the
disconnected machine)
apt-offlinegetupgrade.sig--bundleupgrade.zip
(Download the required data needed to upgrade the upgradable packages. Should be run on a machine
with internet connectivity)
apt-offlineinstallupgrade.zip
(Installs the data needed to upgrade the upgradable packages. Should be run on the disconnected
machine)
After successful completion of
Sequence1 and Sequence2 in order, further running apt-getupgrade will result in 0 bytes of
additional download.
Global Options
-h, --help
Show help message
--verbose
Run in verbose mode
-v, --version
Display the version of the program
Name
apt-offline - Offline APT Package manager
See Also
apt-get(8), apt-cache(8), dpkg(8), aptitude(8),
Synopsis
apt-offline [ARGUMENTS] [OPTIONS]
