Wednesday, June 9, 2010

Installing software offline in Linux

Three or four years back as a university student when mobile broadband was not there and Internet connections cost more I started using Linux. The biggest challenge at that time for me was using it offline. Windows users can easily install a program offline just by clicking on the executable. Some Linux distributions have a collection of DVDs that have extra software which will allow at least old versions of some software to be installed offline but not Ubuntu (the version of Linux that I used that time). It seemed like there is no easy solution for installing new programs in Ubuntu offline.
There are several ways in which you can install a program in Linux. The first is to get the source of the program and compile it your self. This is not a practical solution at all for the general user. If you are to compile a usable program you should know what components are there in the program and how to enable them and disable them. For example compiling the Apache Web server requires some knowledge about features and decide whether they should be built or not and if they are to be built in what mode(static or dynamic). Making matters even worse you will need to find dependent libraries and install them before hand. I would not recommend this method. Use it only if you are making changes in sources.
The second method is to use a pre-compiled executables for Linux or generally Unix published by the program developers(as in the case of Sun JDK). The advantage is most of the extra libraries needed are packed in the executable and it will work for you. The downside is not all projects provide such executables and it does not get integrated with the system tightly.
The final method is to use the distributions package management system. Most Linux distributions has adapted such a system like Debian's .deb or Red Hat's .rpm as mechanisms to install new software. Installing a .deb will copy some files into your system and run some initializing script and most importantly store the details of the files added. These packages are structured as small units and they depend on many others. So the actual packages that should be installed to get something working depends on the current system state and can be tedious if installed manually without a tool which automatically does this (such as apt-get or aptitude). When offline these tools fail since they cannot download the necessary files.
In the next post I will write how I did this in Ubuntu.

No comments:

Post a Comment