How to Install Packages on an Offline Linux System (Debian/Ubuntu) using apt-offline

If you are coming from a Windows background, installing software on an offline computer is usually straightforward: you download an .exe installer or a portable .zip file from a connected machine, transfer it to the offline machine via a USB drive, and install it.

However, Linux handles software differently. If your Linux machine is online, a simple command like apt install or using the Software Center is safer and more convenient than Windows. But if your Linux machine is offline, you hit a wall. You can’t just copy a single installer file because Linux software relies on “dependencies.”

Installing an application (Package A) might require Package B and C, and Package C might depend on Package D. Without an internet connection, your system can’t resolve and download these dependencies automatically.

To solve this, we can use a tool called apt-offline. It helps you generate a “shopping list” (signature file) of all missing dependencies on the offline machine, which you can then fulfill using any computer with an internet connection.

0. Prerequisites

The Offline Machine

Must be running a Debian-based Linux distribution (e.g., Ubuntu, Debian…).

How to check: Open your terminal and type apt. If you see a list of commands, you are good to go. If you see apt: command not found, this guide is not for your system (you might be on RedHat/Fedora).

The Online Machine

Any computer with an internet connection.

It can be running Linux (easiest) or Windows (requires Python).

1. Installing apt-offline

We need the tool installed on both computers first.

1.1 On the Online Machine (If Linux)

Simply install it from the repository:

sudo apt install apt-offline

Verify the installation:

apt-offline --version

1.2 On the Offline Machine

Since this machine has no internet, we need to “sideload” the installer.

  1. On your connected computer, go to pkgs.org.
  2. Search for apt-offline and download the .deb file.
    • Note: Look for a file ending in _all.deb. This means it works on any architecture (Intel, AMD, or ARM).
  3. Transfer the file to your offline machine via USB.
  4. Install it using the command line (recommended to see errors):
sudo dpkg -i apt-offline_*.deb

2. The Workflow: Installing Software

(Optional) Step 1: Update Repository Lists

If your offline machine hasn’t been updated in a long time, its knowledge of available software packages will be outdated. It’s highly recommended to do this step first.

1. [Offline Machine] Generate an update request:

sudo apt-offline set update.sig --update

This creates a file named update.sig.

2. [Online Machine] Download the update data: Transfer update.sig to the online computer and run:

apt-offline get update.sig --bundle update.zip

3. [Offline Machine] Apply the update: Transfer update.zip back to the offline computer and run:

sudo apt-offline install update.zip

Your offline machine now knows about the latest software versions.

Step 2: Install Your Application

Let’s use PDF Arranger (a lightweight tool for merging/splitting PDFs) as an example.

1. [Offline Machine] Generate the install request: Tell the system what you want to install. It will calculate all missing dependencies.

sudo apt-offline set pdf-arranger.sig --install-packages pdfarranger

This creates the “shopping list” file: pdf-arranger.sig.

Note: If you get an “Unable to locate package” error, perform the Optional Step above.

2. [Online Machine] Download the packages: Transfer the .sig file to your connected computer and download the bundle:

apt-offline get /path/to/pdf-arranger.sig --bundle pdf-arranger.zip

This creates the “delivery package”: pdf-arranger.zip.

3. [Offline Machine] Install the software: Transfer the .zip file back to the offline machine.

First, load the data into the local cache:

sudo apt-offline install pdf-arranger.zip

(The terminal will show that data is being synced to /var/cache/apt/archives)

Second, trigger the actual installation:

sudo apt install pdfarranger

Since all dependencies are now sitting in your cache, the installation will proceed instantly without needing the internet.

Appendix: Using Windows as the Online Machine

If your internet-connected computer is running Windows, apt-offline works as a Python script.

  1. Install Python: Download and install Python from python.org. Crucial: Ensure you check the box “Add Python to PATH” during installation.
  2. Download apt-offline: Go to the apt-offline GitHub Releases, download the apt-offline-***-windows.zip (zip), and extract it to a folder.
  3. Open Terminal: Inside the extracted folder, Right Click and select “Open in Terminal”.
  4. Run Commands: Use the python prefix for commands.
    • For example, to download the bundle:
python apt-offline get pdf-arranger.sig --bundle pdf-arranger.zip