announcement

Update: Check new design of our homepage!

How to Install RPM in Linux

How to Install RPM in Linux

Installing RPM in Linux, though not a tough job to do, needs a little understanding of the subject. Find more information about it in this article.
Techspirited Staff
RPM is a very powerful package of Linux, which is used by Red Hat, Suse, and Fedora versions of Linux.

What is RPM Package Manager?

It basically stands for two things ― a software packaged in this format and a software package file format. It was originally abbreviated as Red Hat Package Manager. However, now it stands for RPM Package Manager, as it is used by many other Linux distributions and also by operating systems like Novell NetWare and IBM's AIX. A single command allows the user to install the entire package and delete the same. There are various other features that it offers.

To install the package, all that you need to do is type rpm, followed by the package name. However, typing the command followed by the package name will not simply install a package. It is a very useful command and can be used for upgrading and removing installed packages and for a lot of other applications. So, let us take a look at this command along with the different arguments that can be used with it.
  • rpm -ivh rpm_file, (where rpm_file is the name of the file) is used for installing this package.
  • rpm -Uvh rpm_file is used for upgrading an existing package.
  • rpm -qa for displaying the list of installed packages.
  • If you want to view the complete information about an installed package, simply type rpm -qi packagename (where packagename stands for the name of the package whose information you want to view).
  • If you want to display the list of configuration files for a package then simply type rpm -qc packagename and for viewing which package a command belongs to type rpm -qcf (path to the file).
  • rpm -qa ― last will display the list of recently installed RPMs.
  • Now, let's come to the dependencies part. Many packages may have certain dependencies, which are required for their smooth functioning. rpm -qpR rpm_file or rpm -qR package_name can be used for checking out the dependencies of a particular package.
  • To remove an installed package, type rpm -ev package_name. This command will also check for dependencies.
  • If you do not want to check for the dependencies, simply type rpm -ev ― nodeps package_name.
Other RPM Options
  • ― excludedocs: Used for not installing any documents during the installation.
  • ― includedocs: To install documents during an installation.
  • ― replacepkgs: To replace a package with a fresh copy of the same.
  • ― force: If there are any package and file conflicts, this command can be used to ignore the same.
  • ― percent: To display the percentage of installation.
The Process of Installation
  • First of all, you need to download the yum source code and store it at a specific directory.
  • Move to the directory where you have downloaded the package with the cd path to package command.
  • Type tar -xvf yum(versionno), where versionno is the version number of the yum package you will be installing. Tar command is used to unzip the package. Once the packages are unzipped you can move over to the unzipped directory using the cd yum(versionno) command.
  • Type the command ./configure. It will configure the makefile for this particular software.
  • Type the make command to create binaries.
  • After all this is done, simply type make install to install the software.
However, keep it in mind that for installing the software you need to login as the root user. If in case you are not the root user, then use the su command before installing the software to login as the root user.