-->

How to use RPM Commands in Linux

Author Piyush Gupta

RPM command is used for installing, uninstalling, upgrading, querying, listing, and checking RPM packages on your Linux system. RPM stands for Red Hat Package Manager.
With root privilege, you can use the rpm command with appropriate options to manage the RPM software packages.

In this article, let us review command details of rpm command.

COMMAND DETAILS
RPM COMMAND
Install a package
rpm -i {package.rpm}
Update package
rpm -U {file.rpm}
Remove an installed package
rpm -e {package}
List all installed packages
rpm -qa
List files in an installed package
rpm -ql {package}
Show information about installed package
rpm -qi
Show information about package file
rpm -qpi {file.rpm}
List files in a package file
rpm -qpl {file.rpm}
Verify all installed packages
rpm -Va
Verify installed package
rpm -V {package}

Example:

For installing packages on RedHat based systems, we use rpm (Red Hat Package Manager) command.
rpm -i package-1.2.3.rpm

Installing Package:

To install a rpm package using command line on redhat based system use -i command line switch with rpm command.
rpm -i package-1.2.3.rpm
You can also use YUM or DNF package manager to install downloaded rpm file. Its benefit to resolve dependencies required for the package.
yum localinstall package-1.2.3.rpm     ## CentOS, RHEL systems 
dnf localinstall package-1.2.3.rpm     ## Fedora systems 

Removing Package:

In case if we need to remove any package use -e command line switch with the package name.
rpm -e package-1.2.3.rpm

No comments:

Post a Comment