One of the biggest hurdles for the already popular distribution Ubuntu in gaining still more popularity all across the world, is the limited number of applications shipped as part of the distribution media. Where most of the distributions provide users with the option of downloading a number of CD/DVDs(Fedora, SUSE, Debian) at one time, Ubuntu follows the philosophy of keeping things simple by offering only 1 CD/DVD worth of software, that includes one popular application per task(one web browser, one text editor, one media player etc), allowing users to download and install additional applications whenever needed from the Internet repositories. Though I personally like this philosophy very much(which is also one of the reasons why I like GNOME more than KDE), this works well only for those users who either don’t require anything more than the installed default applications or those who have a fast Internet connection to download the necessary additional applications. The users with slow/no Internet connection are left wanting in this kind of setup as it is almost impossible to conveniently add more applications to Ubuntu without decent Internet connectivity. This is the primary reason why many of my friends go for the distributions like Fedora or SUSE, or even Debian, rather than Ubuntu or Gentoo, even if they like the latter distributions more.

One workaround for this problem is to follow the elaborate procedure described in my earlier post to update and install new applications on Ubuntu without needing a fast Internet connection. With the latest version of Ubuntu – Ubuntu 6.10(Edgy Eft) – though, the procedure has become fairly straight-forward, thanks to a feature added to the Synaptic Package Manager just for solving this problem. You can get the entire idea by just looking at the two new options present in the File menu in Synaptic Package Manager; otherwise, below is an example of how to install an application on Ubuntu by using the Internet connection of a second machine.

Simple Way to Install Applications in Edgy Without Internet Connection
  1. Start Synaptic Package Manager(SPM). Mark all the applications that you want to install/upgrade in the usual way. For example, go to “Edit -> Search”, enter ‘gnuplot’ in the search field and then press ENTER or click “Search”.
    Search a package in Synaptic Package Manager
    From the list shown, mark ‘gnuplot’ and ‘gnuplot-doc’ pacages for installation. After that, instead of clicking the “Apply” button from the toolbar as you would normally do, go to the File menu and select “Generate Package Download Script” menu option to generate the download script.
    Generate Download Script in Synaptic Package Manager
  2. A dialog box will prompt to save the generated script file. Give it a name like ‘ubuntu.sh’ and click the “Save” button. This script file needs to be carried to a machine which has a fast Internet connection and it needs to be executed there.
    NOTE: It will be convenient if the machine with fast Internet connection runs some flavour of GNU/Linux operating system with wget installed on it. If that is not the case, then one needs to tweak the generated script file(ubuntu.sh in our case) to use whatever command line download manager is available on that machine. The first line may also need to be removed if the script is to be run on a Windows machine. Looking at the contents of the generated script file might give a better idea, as shown below.

    Contents of the Download Script generated by Synaptic Package Manager

  3. Start a shell/command prompt, change to the directory where you want to store the downloaded files and run the script as shown:
    sh# sh ubuntu.sh

    Once the downloads are finished, carry all the downloaded files to the Ubuntu machine and copy them to a new folder(say ‘Downloads’) in the home directory.

  4. Start Synaptic Package Manager again and select the same application(s) that you had selected in Step 1. Select “Add Selected Packages” from the File menu and browse to the folder where you have copied the downloaded files(‘Downloads’ folder in our example). Click “Apply” button from the toolbar. The packages will be installed from the local directory without the need to connect to the Internet.
Additional Notes:
  1. It is always a good practice to first update the Apt cache before marking any packages to be installed/downloaded. This can be done by clicking the “Reload” button in Synaptic Package Manager or by running the command “sudo apt-get update” in a shell. Any way you do it, it requires an Internet connection, how ever slow it might be. If there is absolutely no Internet connection available on the Ubuntu machine(why, oh why, did you chose Ubuntu in the first place ;) ), then you need to keep the cache synchronised with another Ubuntu machine that is frequently updated. See the comment section of my earlier post for more information.
  2. If the machine that has a fast Internet connection is Windows or doesn’t have wget installed, the script file can either be manually edited, or a converted script can be written, to make it work under such an environment. But writing your own script/program to directly generate the download script in required format should be a more productive exercise. A download script similar to what is generated by the Synaptic Package Manager can easily be generated by processing the output of ‘sudo apt-get install command.
  3. Lot of discussion is taking place on how to provide options to upgrade Ubuntu systems offline(snapshots at regular intervals can be released as ISO files, for example), the specification for implementing such a feature is going through active debate among the Ubuntu community members, so if you are interested, you can check out the following pages:

    Offline Updater Specification
    Related Wiki

    CDRom Based Upgrade Specification
    Related Wiki