HOW TO INSTALL RPM FILES

Post date: 22-Mar-2010 07:37:06

There are acctualy two types of RPM packages :

- Source rpm, with .src.rpm extension

- Binar, with .rpm extension

Both packages can be used with the RPM command, then again in this tutorial will speak about the BINAR ones. For starters you should pay attention to the version of the RPM packet your are downloading, it has to match the architecture of the target computer (i386,i586, i686, sparc, usulay search for i386). Most of the times these packages are well organized on FTP servers, you just need to search in the right directory.

Once you downloaded the file, it doesnt really matter where is the directory you want to install it. Even tough, you may notice that RedHat has a special DIRECTORY used for storing this kind of packages before they get installed. You dont HAVE to use it but if you have a multi-user system, it can make things more organized.

The directory we talked about can be found in /usr/src/redhat/RPMS on RedHat distrios. 

Now lets start learning how to install RPM packages.

For startares, you should use "rpm --help" to get a glance at all the options the RPM command offers. Becouse RPM has lots of options you will probably end up with more then one page of content. To really sum it up nicely, you should use this command : "rpm --help | less", or you could useShift+PageUp/PageDown for scroling up and down.

Let's get started. The basic command for installing a RPM package is "rpm -i[options] [rpm package]". For example : "rpm -i daniel.rpm" will install the daniel.rpm package. Its usefull to also add the -vf options for the display of a progress bar. Using the progress bar, your final command is "rpm -ivh daniel.rpm".

Now lets say you want to UPDATE an already installed package. The "Red Hat Package Manager" (RPM) also supports the UPDATE of files, all you need to do is use this command : "rpm -U new_daniel.rpm" . And of course you could also add the -vf extra for the progress bar. If lets say, something went wrong in the UPDATE we can also return to the older version by using this command : "rpm -U --oldpackage [old_rpm_package]". For example : "rpm -U --oldpackage daniel.rpm".

And now lets say you want to UNINSTALL a package, you use this command : "rpm -e [rpm package]", for example : "rpm -e new_daniel.rpm" . Some options can really help in this case. For example "--nodeps" used like this "rpm -e --nodeps new_daniel" will uninstall the package, but without checking if any other packages deps are destroyed. Now becouse this command can cause problems, its a good ideea to always use an option that will just SIMULATE the UNINSTALL before you really UNINSTALL. This command : "rpm -e --test new_danie.rpm" will display a list with all the DEPS that could get damaged if the UNINSTALLATION really ocured.

Besides these operations, you could use the RPM COMMAND for other usefull operations like :

rpm -q -a #displays a list with packages already install on the system

rpm -q -l new_daniel #displays a list with files contained by this package

rpm -q -c new_daniel #displays the configuration files of the "daniel" package

rpm -q -d new_daniel #displays the HELP files for the package

rpm -q -i new_daniel #displays information about the package (size, url, description)

rpm -q -R #displays all of the package deps (dependencies)

Compiled from# http://www.tutorial5.com/content/view/48/51/