Originally Published: Tuesday, 9 October 2001 Author: Maninder Bali, CEO, Centurion Linux
Published to: enhance_articles_sysadmin/Sysadmin Page: 2/3 - [Printable]

Application Management on Linux: Installing, Upgrading and Uninstalling Software from your Linux box.

For many people a big challenge between installing and starting to get anything out of Linux is dealing with software downloads. There might seem like a bewildering array of options. Actually though, the process is fairly simple and logical, that shouldn't be surprising, since this is only a computer, after all. In this article Linux.com contributor Maninder Bali lays out the steps needed to manage your applications and downloads, in source and RPM binaries.

Source Packages  << Page 2 of 3  >>

Source Packages

Source packages are generally available in the .tar.gz format. They contain the source code, tarred and compressed to make the distribution of the software easier. The .tar.gz file you get has all the source files, the Makefiles, and installation scripts that you need to install the software properly on your Linux machine.

Once you run the scripts available in the source package, for example, the configure script, it tailors the software's make system to that of your system. The procedure for installing software from source is very similar. Lets cover the steps to install the software on your system.

To begin with, let's unpack the source code in the .tar.gz file.

$ tar -zxvf filename.tar.gz

Running this command will uncompress and un-tar the package into a directory. In some cases, if you have a .bz2 package available, you might have to first uncompress it using the bunzip2 utility and then un-tar it with the tar command.

$ bunzip2 filename.tar.bz2
$ tar -xvf filename.tar

Having done this, you have to compile the resulting code on your machine. But before you do anything, please make sure you read the README and the INSTALL files available in the software package. These files usually do a great job outlining the entire installation procedure and configuration options. Having read them, you can continue installing the software with the following commands.

Enter into the newly created source directory and run the following commands:

$ ./configure
$ make
# make install

If all these commands are executed successfully, you should have the package compiled and installed on your Linux machine. Lets briefly cover what these commands do.

Running the ./configure in the source code's main directory checks the system for any dependencies the software might have.

You can hack the configure script to change the default installation path, or you could enable or disable certain features. If you want to obtain a list of all the options available to you, type in ./configure --help at the command prompt.

Having run the ./configure script, the next thing you type is make. Running make compiles the entire source code of the package. This command might take a lot of time to execute, depending on the amount of source code it has to compile, and the speed of your machine.

A point to note here is that the ./configure and make commands can be run as a normal user. However, for the third command, make install, you have to be root. This is because the normal user would not have permissions to write to system directories like /bin, /usr/sbin etc. Running make install as root copies the copies the compiled software into its respective directories.

That's about all it takes to install a software package from a source file, like a .tar.gz or .tar.bz2





Source Packages  << Page 2 of 3  >>