Skip to content


How To Install,Upgrade & Extract RPM File.

The Installation Task In Detail :-

You can use the rpm –U command or the rpm –i command to install a package. When the rpm command installs a package, it goes through a number of steps:

*Checking the package and the files it wants to install

*Performing preinstallation tasks

*Uncompressing the files and placing them in the proper locations

*Performing post-processing tasks

*Updating the RPM Database

When checking the package, rpm checks that all the dependencies are installed. Dependencies are packages required by the RPM package you want to install.

Checking That the Package Is Installed :-

Use the rpm –q command to quickly verify a package has been installed. To verify, you need to use the name of the installed package, not the name of the RPM file. You can also use a partial package name :-

# rpm –qa httpd

The rpm -q command just asks the RPM database if the package has been installed. There may be other issues with the package that this command won’t show.

Install a rpm package :-

# rpm -ivh rpm package name

The -i option for to install

The -h option to the rpm command prints out # signs, also called hash marks (hence the -h). These hash marks provide some confirmation that the rpm command is still running.

The -v option to the rpm command tells the command to print out verbose information as the command runs. Remember, though, that verbose is used in the traditional Unix and Linux meaning, which is normally not all that verbose.

Upgrading packages :-

The rpm –U command works for both installation of new packages and for upgrading. The rpm -U command is a very powerful tool and performs some complex operations with just one command.

# rpm -q httpd

httpd-2.0.3-31.el5

# rpm -Uvh httpd-2.2.3-31.el5.i386.rpm

# rpm -q httpd

httpd-2.2.3-31.el5

Note that the old version of the httpd package is no longer installed. The rpm –U command removed that package & upgrade it with new version.

Freshening up packages :-

A freshen operation means to install a new version of a package only if you have already installed another version of the package. Thus, a freshen operation is very similar to the upgrade operation except that a freshen requires you to have previously installed the package, while an upgrade can install a package for the first time. The basic syntax for freshening a package is to use the -F option.

# rpm -Fvh package_name

# rpm -Fvh httpd-2.2.3-31.el5.i386.rpm

You can also use the –freshen long option in place of -F.

As with upgrading, the options to the rpm command are the same, except for the -F or –freshen option that indicates the operation. These are the options discussed in the sections on upgrading and installing software.

Extract an RPM Package Without Installing it like tar or zip file :-

# rpm2cpio rpmpackagename.rpm
# rpm2cpio rpmpackagename.rpm | cpio -idmv

For more information regarding RPM please read the following knowledgebase :-

http://docs.fedoraproject.org/drafts/rpm-guide-en/

Enjoy Linux….!!!!! :)

Posted in Linux tutorials.

Tagged with , , , , .


4 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. genesis says

    Not bad article, but I really miss that you didn’t express your opinion, but ok you just have different approach

  2. MarkSpizer says

    great post as usual!

Continuing the Discussion

  1. How To Install,Upgrade & Extract RPM File. – www.unixsurgeon.com | Linux Affinity linked to this post on March 17, 2010

    [...] more from the original source: How To Install,Upgrade & Extract RPM File. – http://www.unixsurgeon.com Posted in: How To's, Server ADD [...]

  2. PHP Tutorial: Installation and The Basics | PHP WebDev Insider linked to this post on March 17, 2010

    [...] How To Install,Upgrade & Extract RPM File. – http://www.unixsurgeon.com [...]



Some HTML is OK

or, reply to this post via trackback.