RPM (Redhat Package Manager) is a powerful package management utility build for the Redhat-based system. Which is responsible for the create distributable packages for your applications. It is also used for the installing, updating, and removal of packages from any Redhat-based systems.
This tutorial will help you to understand about uses of the rpm command-line utility. After reading this you will understand the installation, updating, or removal of RPM packages from your system.
How to Install .rpm File
The rpm packages can be installed using the “rpm” command-line utility on the Redhat-based systems. It is capable to install a package from the local y downloaded “.rpm” file or on a remote URL. For example, to install a package locally, use -i command line switch followed with the package name.
rpm -i package-1.2.3.rpm
The above command does not search for the required dependencies of the packages. If the dependencies are not installed on your system, the above command will fail.
If your system is connected to the Internet, Use YUM or DNF package manager to install the downloaded rpm file. This will help you to install the dependencies required for the package.
yum localinstall package-1.2.3.rpm
## Using yum command
dnf localinstall package-1.2.3.rpm
## Using dnf package
Upgrade .rpm Package
Use the “-U” command-line switch to upgrade the current packages installed on your system. This will also install the package if the package is not already installed.
rpm -U package-1.2.3.rpm
Remove a RPM Package
The package that is no more required, should be removed from the system. Use
-e with the rpm command followed by the package name to erase from the system.
sudo rpm -e package