How To Install and Upgrade RPM Packages In CentOS, RHEL, Fedora, Mandriva

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/install-upgrade-rpm-packages-centos-rhel-fedora-mandriva/
PINTEREST
PINTEREST
INSTAGRAM

rpm is the package format used by popular distributions like RHEL, CentPOS, Fedora and Mandriva. We generally prefer to use yum command to install packages from internet automatically and easily. In some cases we may need to install rpm packages solely. In this tutorial we will look how to solve dependency and install rpm package.

Linux Rpm Command With Examples

Download RPM Package

We can get RPM files from different sources. In the old days RPMs generally provided with CD or floppy disk but today internet is de facto source to get RPM files. We can use following sites to search and download RPM files for different distributions, architectures.

http://rpm.pbone.net

In this exmaple we will download RPM file with wget.

Download RPM Package

Download RPM Package

List RPM Package Dependencies

As we know packages generally requires some libraries and other packages to work accordingly. This is called package dependency. We should can list package dependencies to check whether the system met required packages.

List RPM Package Dependencies

List RPM Package Dependencies

As we can see there are some dependencies like libc, libnfnetlink etc.

Install RPM

Now we assume we have installed required dependencies and ready to install our downloaded RPM package. We will provide -ivh options and the RPM package name to the rpm command. We should also have root privileges where we can get with sudo like below.

Install Ignoring Dependencies

In some cases the system can not meet required dependencies but we should install package. May be the package can work without problem without some dependencies etc. We can install a package without dependencies with --nodeps option like below.

LEARN MORE  Compare CentOS(RedHat) vs Ubuntu

Verify RPM Package Is Installed

After the installation is completed we can verify that the specified package is installed correctly. We can list installed RPM packages with -qa option and then grep the the package we recently installed. In this example we check the iptablespackage.

Upgrade RPM

If the package is all ready installed we should upgrade to preserve the existing package configuration. We can upgrade all ready installed RPM package with the new version with -Uoption like below.

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/install-upgrade-rpm-packages-centos-rhel-fedora-mandriva/
PINTEREST
PINTEREST
INSTAGRAM

You may also like...

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)