Upgrading and Installing with RPM

RPM Package Manager

RPM package manager is commonly use with RHEL/CentOS based Linux Distros. The name Redhat Package Manager or RPM, refers to the files format, .rpm

  • If you are attempting to install from a RPM file, you will need to specify with the “-i” option.
  • If you are attempting to upgrade from a RPM file, you will need to specify an upgrade with the “-U” option.

The Man Page:

INSTALL AND UPGRADE OPTIONS
    The general form of an rpm install command is

    rpm {-i|--install} [install-options] PACKAGE_FILE ...

    This installs a new package.

    The general form of an rpm upgrade command is

    rpm {-U|--upgrade} [install-options] PACKAGE_FILE ...

    This install the package or upgrades the package currently installed  to  a  newer
    version.   This  is the same as install, except all other version(s) of
    the package are removed after the new package is installed.

Here is an example of installing from a RPM file.

rpm -ivh <rpm-file.rpm>

Three are several things you should note. First, you see that i specified the -i option to install using RPM for an rpm file. next i use the -v option which will verbose the output. Meaning more output. finally, the -h option. Which allowed me to see the progress in hashes.

# rpm -ivh kernel-2.4.21-15.0.3.EL.i686.rpm
Preparing...                ########################################### [100%]
   1:kernel                 ########################################### [100%]

Here is an example of upgrading using RPM.

Well need to check and see if the package we’re upgrading is already installed and is in the database.

rpm -q <packages name> 

rpm -q httpd 
httpd-2.0.46-32.ent

If you are upgrading multiple files, feel free to pipe when checking to see if the packages are already installed. Now for the installed. Next well upgrade the file.

rpm -Uvh <rpm-file.rpm>

As you can clearly see, -U for upgrade was specified. Along with -v for verbose and -h for which allows us to see the progress in hashes.

 

 

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s