Monday, July 25, 2011

Offline Package Installation using Synaptic Package Manager in Ubuntu

If you don't have an active internet connection at your Ubuntu machine, you can still install software packages/updates etc by using an installation script generated by Synaptic Package Manager.

Note that Synaptic Package Manager isn't scheduled to come installed by default in Ubuntu 11.10 and later. So, if you are using Ubuntu 11.10, you first need to install it. The easier method would be to take your offline PC to a location where you could connect it to the Internet. Or arrange a one time Internet connection for this PC. Once connected to the Internet, from Terminal:

sudo apt-get update
sudo apt-get install synaptic

Generating the Download Script

Open up Synaptic Package Manger by going to System > Administration > Synaptic Package Manager or by searching the Dash in Unity. Search for and mark the intended packages you want to install.

Mark the dependencies also, if any.

Mark as many packages as you want to.

When satisfied, instead of clicking the 'Apply' button that you normally do when installing from Synaptic, go to File > Generate package download script instead.

Save the script wherever you want to.

Now copy the generated script file to a USB drive and get to an online computer, whether Ubuntu/Linux or Windows.

Executing the script in Ubuntu

Copy the script from your flash drive to any directory (creating a new directory is recommended as the packages would be saved in the same directory) and just double click the script file.

Choose 'Run in Terminal' and wait for the downloads to finish. Once completed, copy the newly created directory containing the packages back to your flash drive.

Executing the script in Windows

You would need Firefox with the DownThemAll add-on in Windows.

So, first install DownThemAll from here if not already installed:

Now in Firefox, go to File > Open File... and open your script file. The script containing the download links should be displayed in your current tab now.

Right-click in the page and choose DownThemAll. All files should already be selected for download. If not, tick All Files under Filters. Next, choose the directory into which the packages shall be downloaded. When ready, simply click 'Start' to begin the download process. Once completed, move the downloaded packages to your flash drive.

Installing the Packages

Open up Synaptic on the target PC and go to File > Add downloaded packages.

Navigate to the directory containing the downloaded packages and click 'Open'.

Review the changes and click 'Apply'.


Installing Updates via Synaptic's Offline Script

You can keep your Ubuntu PC updated by following a similar but a bit comprehensive method. Please take a look at this post:

Related Posts:

Installation , Package Manager