Linux Package Installation
Willy Sudiarto Raharjo
4 March 2006
5 comments

Introduction

Linux that was built by Linus Torvalds in 1991, was only kernel, which can do nothing without other utility or tools. In order to build a complete operating system, Linux need another utility or tools that is functional to do some spesific task, such as word processor, spreadsheet, and others. These tools often build on package, which consists one or more application bundled. Some of the application that was bundled with Linux was developed under GNU Project. This is the main reason why Linux is often called with GNU/Linux. Nowadays, many GNU/Linux developers have been inserting so many application on their distro to help their user to work as soon as possible after they install GNU/Linux on their computer. But, unfortunately, there are so many application that were developed and it was impossible to include them all on the CD's. In oder to use that applications, we should download, install and configure them by ourself. The problem is not "how do i find this package", but rather "how do i install these package?" GNU/Linux is not using the Window's "click-and-next" approach and it has many options to install packages, so this is where this articles will come and help you through installation process. This article will help you through four kind of common installation, which is RPM, binary, tgz, and source. There is another package, which is DEB, but this package is focused only for Debian and i'm not running Debian. The example application will be Gaim, multiplatform and multi protocol Instant Messaging Client for RPM and Source and OpenOffice.org, a complete replacement for Microsoft Office for binary

RPM

Let's start with RPM first. RPM (RedHat Package Manager) was a great packaging manager, which helps so many newbie GNU/Linux user to install application on their computers. It is easy to use and there are manual that was spesifically written and it is included on your distro. It has complete feature for package manager, like install, upgrade, remove, query, verify, etc. A package consists of an archive of files and meta-data used to install and erase archive file. The meta-data files includes helper-script, file attributes, and descriptive information about the package. Packages comes in two varieties : binary packages, used to encapsulate software to be installed, and source packages, containing the source code and recipe necessary to produce binary packages. RPM has so many parameter, so it is impossible to write them all in this article, but i will list some common parameter that often used.

From first sight, RPM seems to be very easy to use, but later on, you will meet some problems installing a package using RPM, especially when you encounter dependency problem. Dependency is a condition where some package can not be installed properly without installing another package. This is the consequency from the modular approach taken by many OpenSource project, which will help developers to reduce problems when they encounter a glitch on some package. They just need to update the package which contain bug, not to all packages. This will also help users, because the size file become smaller, since you don't have to download all the package and the library needed (unless you don't have it on your CD's). In order to solve this problem, you have two options : install all requirement first and then install the package (or if you have download all the requirement, place them all in the same directory with your package and type rpm -ivh *) or use --nodeps parameter. This parameter will order RPM to skip dependency check before installing/upgrading package. This is not recommended since some functionality will be unavailable or the application became unstable

SRC.RPM

What you have seen above was the installation from binary packages, but about with source packages? Good questions. Source packages, in the other hand, still consists of the original source code, before we start installing process, we should compile them first. In order to recompile and rebuild the source package, we use rpm --rebuild gaim-0.81-0mdk10.0.i586.src.rpm. Note the src extension added before the rpm? It is a sign that we use source packages. This command will order RPM to rebuild the package and configuring it to suit with our systems. This package is best used when you can't find the correct package for your architecture. After the rebuilding process is complete, you will find the rebuilded package in /usr/src/RPM/RPMS/i586 (the location can be vary and it depends on the distro that you use and the architecture of your processor). After you locate the package, you can install it with rpm -ivh gaim-0.81-0mdk10.0.i586.rpm

Using Source Package has another advantage. It will adapt with your system. For example: if package A need package B version 2.5.2 and you only have 2.4.8, you probably cannot install package A until you upgrade your B package. If you use source package, there is a change to install package A without upgrading B to the latest version. But it is recommended to install the fullfill the requirement, since the new packages usually contain bug fix that was discovered on the previous release.

TGZ

This package is also a binary package, but it's used for Slackware and it's decendant distro, like Vector Linux. Sometimes, people are confused with this naming, since .tgz can also be tar.gz packages which is a source code which is archieved and compressed. In order to distinguish it, you should look for the contents. If it contains a directory which has the same name with the packages, then it's probably a tarball, but if you see some directory like usr, etc, then it will be Slackware's native format.

Installation is very easy. Use the pkgtool which is a primary tool for Slackware distribution for package management and also to configure your system as well. You can install the package by typing installpkg gaim-1.5.0-i486-1.tgz or upgradepkg gaim-1.5.0-i486-1.tgz for upgrade. If you want to remove it, simply type removepkg gaim. Every packages will be listed in /var/log/packages (just like RPM's database), but you will have to use pkgtool to view package's content.

Source

So far you have learned to install packages from RPM and SRC.RPM, but GNU/Linux offers another method to install packages. Instead of installing a binary package, we will try to use the original source code to build an application and then install them at our computer. The process to build an application is called compiling. Usually, source code was written with C or C++, so before you install packages from source code, install your development library and tools, such as GCC, Autoconf, AutoMake, and library needed. Source code often released in two version: tar.gz and tar.bz2. This two formats was originally an archive file (tar) and it was compressed with aproriate tools (gzip and bunzip2) to reduce it's size.

Let's start the source code installation process. First of all, put the source code on the spesific directory where you have write permission (i usually use /usr/local/src). Next step to decompress and un-tar the source code. If the package was in tar.gz format, use tar -xzvf gaim-0.81.tar.gz. If it was in tar.bz2 format, use tar -xjvf gaim-0.81.tar.bz2. This command decompress and unarchive the files into a subdirectory under current directory. Change to the new directory using cd gaim-0.81. Next, read the README or INSTALL file, which contains instructions how to install the package, since some package need different method. When you finished reading, you will find out that the process is so simple. This steps will explain the common routines that was used to install an application from the source code. You should consult the README or INSTALL or any other manuals included on the package.

Installing from source code gives us more flexibility on controling and configuring the application. For example, we can decide where the files will be located with --prefix parameter. Before you execute ./configure, execute ./configure --help to see all parameters available. Installing from source also have disadvantages. First, the source code doesn't record your package into the database just as RPM does, so you can't query your package using rpm -q <package-name>, but you should find it by yourself using whereis, which, locate, and find command. Second, you can't erase them using rpm -e <package-name>, but you issue the make uninstall command on the directory where you compile the application. This means, you can't delete your source directory, unless you want to execute ./configure again (also with all the parameters you spesified in the installation process).

Binary

Binary package is the easiest among them, because usually it has already include all the requirement, so we only have to execute one command to install the package, just as OpenOffice.org does. Just unpack the packages using tar -xzvf OOo_1.1.2_LinuxIntel_install.tar.gz, change into the new subdirectory, cd OOo_1.1.2_LinuxIntel_install, give the execute permission chmod +x setup and execute the setup program ./setup and off you go.

Tools

In order to simplify the installation process, some tools were created by several developers and integrated on different distro's. On Mandrake, there are URPMI (User RPM Interface). In RedHat, there are YUM. Also there are APT-GET tools for Debian, which considered as the best packaging manager with emerge from Gentoo. Slackware also have swaret or slapt-get to maintain package in their system. This tools usually have solved some dependency problems, so it will help your life easier with GNU/Linux.

Last Update : 5 June 2006 :: 15:11:25

Comments

1 @sokol : I don't know what this means :D (maybe you can translate them in English)

@om_pirdi : semoga bisa bermanfaat buat Anda

Posted by Willy Sudiarto Raharjo on 12 Apr 2006 @ 09:01:56

2 Hilsen fra Klovnen "Tulliball"

Posted by sokol on 5 Apr 2006 @ 04:00:31

3 Wow, untuk beginner sangat praktis dan sangat mudah dipahami.. thanks ya bung willy...

Posted by om pirdi on 27 Mar 2006 @ 21:18:26

4 thank u om willy...for being my master :D

Posted by ewin on 22 Mar 2006 @ 19:05:52

5 i've seen ...good resources for newbie's installation guide ... :)

Posted by sunu_wibirama ... on 16 Feb 2006 @ 08:29:09

Post Your Comments

Your Name: *Comment:
Kode Rahasia

*Write code above:
Note: * denotes required field