rpm command | Software Management in Linux

Hello everyone In this Article we are going to learn Software Management using RPM in Linux in a very simple and easy step-by-step approach

rpm command

The rpm is the command that is used to verify how many packages are there in our Linux machine also with the help of the rpm command we can add/remove/query how many packages are there in our machine

1 How to Check which package is installed or not

To check whether the package is installed or not then When we add ( -qa ) option with the rpm command we can determine how many packages are there in our Linux kernel.

Where q is to query and a is for all the packages.

# rpm -qa 
Screenshot 14 4

2 How to check the number of packages in the machine

To check how many packages are installed then When we add (wc – l ) command in rpm we can determine how many packages are there in our system.

# rpm -qa | wc-l
Screenshot 1 13

3. How to check specific package

When we write package name with rpm command we can see that whether that package is available or not in our Linux kernel.

Here tar is the package name that we want to check.

# rpm -qa tar
Screenshot 2 12

4. How to erase the package

To remove the package then we can use -ev option where -e is for erase and v is for verbose.

# rpm -ev tar
Screenshot 4 27

How to install the package using rpm command

# df -Th – When we run this command we can see that our DVD is attached in our server in this DVD the packages are already there we just need to install them

Screenshot 39

Go inside to the DVD directory

Screenshot 40

How to Install the Package

When we add ( -ivh ) in rpm command we can install any package in the Linux system where ( -i )is for install ( -v ) is for verbose ( -h ) is to show the loading hash.

# rpm -ivh firefox-68.5.0-2.el7.centos.x86_64.rpm
Screenshot 42

Please note that we have to be inside of the Package directory in order to install the package using rpm command .

How to Update the Package

When we add ( -U ) in the rpm command with the package name we can update the specific package

# rpm -Uvh firefox-68.5.0-2.el7.centos.x86_64.rpm
Screenshot 43

The drawback of using RPM is that we need to resolve the dependencies of the packages we need to install the dependency one by one

Conclusion

If you want to learn Linux in the most simple language then please click on this link.

This is the complete knowledge of how we can install and manage the software in the Linux kernel if you have any doubts please feel free to comment below. Please don’t forget to join our email subscription to get the latest updates on DevOps Articles.

Leave a Comment