For a system connected to internet, Apt works great in handling an application and its dependencies. However updating an application on a system disconnected to internet is kinda difficult. In this article, we will see how to update Debian offline using terminal and GUI.

Internet is easily available and cheap these days. However, sometimes we do get into a situation where an offline system needs to be updated. Sometimes your secondary system is too old to be connected to your Wi-Fi like my 8 years old Lenovo running on a 1GB of RAM and with 80GB storage.

Although you can always download the software, transfer it on the disconnected system and use dpkg to install it, it would be a pain to manually create the list of applications and finding out which of them really needs an update! Even if you manage to do so, handling dependencies is another pain.

Apt-offline does just exactly this for you. It creates a APT database for the system/application which requires upgrade/update. You can then use a system connected to internet to download these along with dependencies and later install on the disconnected system. To update Debian offline, we can call apt-offline an apt solution! This works for any other Debian based system equally well.

In this article, we will see how you can install apt-offline on a connected and disconnected system and how to update a Debian based system offline using apt-offline.

Before we begin, I must tell you apt-offline is available in both terminal and GUI format. We are discussing both of them to update Debian offline, choose whichever suits you better. It’s always better to back up your Linux system before any major upgrades.

Terminal Way to update Debian offline

Installation

For the system connected to internet, use the below command to install apt-offline.

sudo apt-get install apt-offline

For the offline system, download a .deb package from https://pkgs.org/download/apt-offline and install it via any package manger or below terminal commands.

sudo dpkg -i apt-offline_1.X.X_all.deb

Replace X.X with the downloaded version.

How to use it

The steps include generating a signature on your disconnected device and then using the signature file on a online system to download the updates / upgrades and dependencies.

Generating a signature file on the disconnected system

Navigate to /tmp (not mandatory, any directory will do) and use below command to generate the signature file.

sudo apt-offline set /tmp/apt-offline.sig

This will generate the required information which apt needs to update the system. If no arguments passed, it generated the information for both update and upgrade. You can individually pass the below arguments if you wish so.

--upgrade
--update

Downloading packages on a connected device

Once you have the signature file, you can copy it using a removable media or USB onto a system which is connected to internet.

Let us suppose you have put it under /tmp directory. Use below command to download the packages on the online system.

sudo apt-offline get /tmp/apt-offline.sig --threads 5

Updating offline system

Now connect back the USB device to the offline system and use below command

sudo apt-offline install /media/USB/apt-offline.zip

This will update the APT database.

Using apt-offline GUI to update your Debian system

Installation

If you are not a fan of command line, you can use this GUI method. You would have to install the GUI in both the connected and offline system.

sudo apt-get install apt-offline-gui

And download the copy from https://pkgs.org/download/apt-offline-gui to install it on the disconnected device using any package manager or use below command.

sudo dpkg -i apt-offline-gui_1.X.X_all.deb

Replace X.X with the downloaded version.

You can launch it from the terminal or search it under installed applications.

Apt Offline

How to use it

On the offline system, launch the application and click on Generate Signature . Once it’s generated, copy the file to a system connected to internet using USB drive.

Launch the application again and click on Download Packages or Updates. It will ask you to select the signature file and give the filename to save data as. One done, click on Download and let it complete.

Signature generation

Now, move the file to disconnected system and click on Install Packages or Updates. It would ask you to browse the file which we created during the download. Select it and continue with Install.

Update Debian offline

This will update and install all the Apt database applications on your offline system.

Wrapping up

Apt-offline is a great tool for those who either cannot afford a fast internet or has limited bandwidth and can use friends / workplace internet or has a very old system which is difficult to connect to internet.

You can use the above method to update your system and the dependencies. Let us know what you think about it in the comments.