apt-offline(8)

πŸ“¦
version 1.8.6 Β· 3 versions
, in debian trixie, nixpkgs unstable, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– apt-offline(8) β€” USER COMMANDS πŸ’–

okay bestie, sit down, hydrate, because we're about to make offline package management your whole personality. this is the manual for apt-offline, and it's genuinely iconic, no cap. 🫢


✨ NAME ✨

apt-offline β€” Offline APT Package manager

like, the offline era of APT. it's giving "no wifi, still slaying". πŸ’…


🌸 SYNOPSIS 🌸

apt-offline [ARGUMENTS] [OPTIONS]

πŸ¦‹ DESCRIPTION πŸ¦‹

apt-offline brings offline package management functionality to Debian based system. yes, fr fr β€” you can download packages and its dependencies to be installed later on (or required to update) a disconnected machine. and the download? it happens from a different connected machine. main character energy: one laptop has internet, the other one is living its cozy offline life. πŸ”₯

it can also fetch bug reports for the packages that are downloaded. because knowing what broke is part of the vibe check. πŸ’€

okay but real talk: unless the -h/-v or --help/--version options are given, one of the get, set or install commands must be provided. like, you have to pick a lane, bestie.

πŸŽ€ set β€” the signature-making era

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]

set generates a signature file with the data required to install on or update the disconnected machine. it's literally the little note you write so the connected machine knows what to bring back. πŸŽ€

FILENAME {apt-offline.sig} is the signature file generated on the machine. This file will contain all the information necessary for apt. like, everything apt needs to know, packed into one file. obsessed.

  • --simulate β€” Developer only. Used for testing. not for us, that's a dev thing. πŸ™ˆ
  • --install-packages [PKG...PKG_N] β€” Packages that need to be installed. yes, list them all, go off. ✨
  • --install-src-packages [PKG...PKG_N] β€” Source packages that need to be installed. the source-code girlies get their moment too. πŸ’œ
  • --src-build-dep β€” Download Build Dependency packages for the source packages requested. build deps said "we're coming too". periodt.
  • --release release_name β€” Release target to install packages from. pick your era, release_name. ⭐
  • --apt-backend apt-get β€” APT backend to use. One of: apt, apt-get, python-apt. choose your fighter.
  • --generate-changelog β€” Generate changelog of the version to be downloaded. the receipts, the lore, the whole story. πŸ“œ
  • --update β€” Generate APT Database signature for an update. This is the equivalent of using apt-get update. lowkey essential.
  • --upgrade β€” Generate APT Database signature for package upgrade. This is the equivalent of using apt-get upgrade. glow-up time. 🌈
  • --upgrade-type {upgrade_type} β€” Type of upgrade you would like to perform. Default is upgrade. Other valid types are dist-upgrade and dselect-upgrade. so many upgrades, so little time.

🧚 get β€” the download arc

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]

get downloads APT data as per a signature file. it reads the note from set and goes shopping. πŸ›οΈ

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. so like, set first, then get. that's the order, bestie, don't fight it.

  • -d, --download-dir DIR_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. so it's not lost, it's just... vibing in temp. πŸ—‚οΈ
  • -s, --cache-dir DIR_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. reuse, recycle, slay. ♻️
  • --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.
🚨 bestie NO. this one is literally the "trust me bro" option. integrity of the package gets lost, and the manpage itself says usage is highly discouraged. do not.
  • -t, --threads NUM_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. more threads β‰  more iconic. be polite to the servers. 🧘
  • --bundle FILENAME β€” Create an archive file FILENAME. The file is archived in zip format. one file to carry them all. πŸ’–
  • --bug-reports β€” Download bug reports for packages that are being downloaded. Currently only the Debian BTS is supported. it's giving "we also grabbed the drama". 😭
  • --proxy-host β€” Specify the Proxy Host to be used.
  • --proxy-port β€” Specify the Proxy port number to be used.
  • --https-cert-file FILENAME β€” The Certificate-file to use if https-client-authentication is required on one or multiple hosts.
  • --https-key-file FILENAME β€” 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. the security girlies are side-eyeing this one, ngl. πŸ‘€
  • --http-basicauth URL β€” A username/password encoded in the URL. Note Passwords with special characters should be percent encoded as per RFC-3986 section 2.1. yes, the RFC said so. look it up. πŸ“š

πŸ‘‘ install β€” the moment it all comes together

install FILE/FOLDER [-h] [--skip-bug-reports ] [--install-src-path PATH]
    [--allow-unauthenticated]

install installs APT data to the APT package database and updates it. the grand finale. the payoff. the "we did it Joe". πŸŽ‰

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. one or the other, bestie, pick your entrance. πŸšͺ

  • --simulate β€” Developer only. Used for testing. again, devs only. πŸ™ˆ
  • --skip-bug-reports β€” Skip listing of downloaded bug reports, if any. not in the mood for drama today? valid.
  • --skip-changelog β€” Skip display of changelog, if any. skipping the lore, respectfully.
  • --allow-unauthenticated β€” Don't verify GPG signatures for the data to be installed to APT. Usage of this option is highly discouraged.
🚨 another "highly discouraged" one!! no GPG signature verification = no proof of where this came from. the manpage is literally begging you. do not, bestie.
  • --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.

so like, "network needed but nothing downloaded"? yes, that's the caveat, and we're being honest about it. πŸ’€
  • --install-src-path PATH β€” Path to filesystem where we want the source packages to be installed to. Default will be a folder in your TEMPDIR. source packages get a home. 🏑

🌟 GLOBAL OPTIONS 🌟

  • -h, --help β€” Show help message. the "explain it to me again" button, but make it official.
  • --verbose β€” Run in verbose mode. it will tell you everything. it will not shut up. we love it. πŸ’¬
  • -v, --version β€” Display the version of the program. the "who even are you" option. ⭐

more of this iconic manual is coming, bestie β€” don't go anywhere 🫢

πŸ’« EXAMPLES πŸ’«

NOTE: argument/option handling, bestie, listen up πŸ‘‚

apt-offline leans on argparse for all its argument/option parsing. So if you wanna be super explicit about what's an argument, you can yeet it across with the -- delimiter.

Example:

apt-offline set --update --upgrade --install-packages wm2 -- foo.sig

By dropping that -- delimiter in there, we're telling apt-offline that foo.sig is an argument to the apt-offline command itself, and NOT a value for the --install-packages option. iconic behaviour, honestly.

Otherwise? You can just put it positionally right next to the set command instead:

apt-offline set foo.sig --update --upgrade --install-packages wm2

🌸 apt-offline set FILENAME

This command generates a signature file FILENAME for the APT Package Database. Genuinely the first step of the whole glow-up ✨.

  • Wanna generate only the signature for updates? Use the --update option.
  • Wanna generate only the signature for package upgrades? Use the --upgrade option.

πŸ¦‹ apt-offline get FILENAME

This command fetches all the data the APT Package Database needs, following the signature file FILENAME that was generated by apt-offline get. Yes bestie, it said apt-offline get in the original, we don't fix what we didn't write πŸ’….

  • Wanna pull down bug reports too? Use the --bug-reports option. Currently the only bug tracker supported is Debian BTS. That's it, that's the list.
  • By default β€” like, if neither -d nor the --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. So on a Linux machine it'd look something like:
/tmp/apt-offline-downloads-23242/

πŸŽ€ apt-offline install FILE|FOLDER

This command syncs the data you downloaded with apt-offline get back into the APT Package Database and updates it. Depending on where the data was downloaded to or packed into, you can hand it either the absolute FOLDER path or the archive FILE path. Either one, she's flexible πŸ’β€β™€οΈ.

NOTE1: On a freshly installed box β€” one that got installed without the network β€” the package database is null. Nothing in it. Empty. In that case, you first need to run apt-offline with just the --update option to make sure you have a meaningful package database.

Example:

apt-offline set set.uris --update
NOTE2: On a fresh setup installed through CD/DVD, the default APT setting lists only the install media URLs. In that 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.list or /etc/apt/sources.list

deb https://deb.debian.org/debian stable main contrib

(For Debian Stable)

deb https://deb.debian.org/debian unstable main contrib

(For Debian Unstable/Sid)

deb https://deb.debian.org/debian stretch main contrib

(For Debian Stretch)

deb http://security.debian.org stable/updates main contrib

(Security Updates for Debian Stable)

deb http://security.debian.org testing-security/updates main contrib

(Security Updates for Debian Testing)


🌈 Sequence 1

The following set of commands, when run in sequence, will update a disconnected machine. Periodt. No internet required on the target box πŸ”₯.

apt-offline set update.sig --update

(Generate the required data needed to update the APT database. Should be run on the disconnected machine)

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)

apt-offline install update.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. Main character energy, honestly πŸ‘‘.

apt-offline set upgrade.sig --upgrade

(Generate the required data needed to upgrade the upgradable packages. Should be run on the disconnected machine)

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)

apt-offline install upgrade.zip

(Installs the data needed to upgrade the upgradable packages. Should be run on the disconnected machine)


After successful completion of Sequence 1 and Sequence 2 in order, further running apt-get upgrade will result in 0 bytes of additional download. Zero. Zilch. Nothing. slay πŸ’…βœ¨

✨ AUTHOR ✨

apt-offline is written by Ritesh Raj Sarraf (rrs@researchut.com).

If you wish to report a bug in apt-offline, please see https://github.com/rickysarraf/apt-offline or else, send an email to me at rrs@researchut.com. Bestie, the maintainer is literally reachable, use it 🫢

🌸 SEE ALSO 🌸

apt-get(8), apt-cache(8), dpkg(8), aptitude(8),

πŸ’– DEDICATION πŸ’–

This software is dedicated to the memory of my father Santosh Kumar Sarraf. We miss you a lot. πŸ•ŠοΈ


okay that's the whole page bestie, you ate it up πŸ’… This one's apt-offline version 1.8.6, dated February 08, 2025 β€” go forth and offline-install something, queen πŸ‘‘βœ¨

πŸ“¦ where this page comes from