Sunday, July 23, 2023

Examples of RPM Commands in Linux | RPM Command Example | RPM management in RedHat | CentOS | Rocky Linux

 

1. How to install package

rpm
-i package.rpm 
rpm -ivh package.rpm
or 
rpm -ivh rpm_package_url.rpm
RPM URL like

https://dl.rockylinux.org/pub/rocky/8.8/AppStream/x86_64/os/Packages/v/vim-common-8.0.1763-19.el8_6.4.x86_64.rpm
 


2. How to upgrade a RPM package

rpm -U package.rpm 

3. How to uninstall a RPM package 


rpm -e packageName

4. How to query information about RPM package

rpm -q packageName

5. How to list all installed RPM package 

rpm -qa 

6. How to verify integrity of installed RPM package

rpm -V package.rpm

7. How to query the files belonging to the RPM package 

rpm -ql package.rpm

8. How to find which package owns a specific file

rpm -qf /path/to/file

9. How to install a RPM package without dependencies

rpm -ivh --nodeps package.rpm

10. How to import GPG key for package verification

rpm --import  /path/to/gpg_key.asc

11. How to list documentation file of package

rpm -qd Package_name

12. How to list configuration files of RPM package

rpm -qc Package_name

13. How to restore package with their permissions:

rpm --setperm Package_name.rpm

14. How to display package information in a more verbose format

rpm -qi Package_name.rpm

15. How to Display changelog of a package

rpm -q --changelog Package_name

16. How to query the package providing a specific library

rpm -q --whatprovides library_name

17. How to verify all installed packages on the system

rpm -Va 

18. How to List dependencies of a package

rpm -qR Package_name

19. How to Verify the signature of a package file

rpm --checksig package.rpm

20. How to list all configuration files that have been modified

rpm -Vc

21. How to display the package containing a specific executable

rpm -qf $(command -v executable_name)

22. How to show the size of a package

rpm -q --queryformat '%{SIZE}\n' package_name

23. How to list RPM scripts (pre/post install/uninstall) of a package

rpm -q --scripts package_name

24. How to query packages sorted by installation date

rpm -qa --last

25. How to show the vendor of a package

rpm -qi package_name | grep Vendor

26. How to display the license information of a package

rpm -qi package_name | grep License

27. How to rebuild the RPM database

rpm --rebuilddb



No comments:

Post a Comment

Installing Jenkins on RHEL 8 is a straightforward process. Here's a step-by-step guide

Introduction  Jenkins is an open-source automation server widely used for continuous integration (CI) and continuous delivery (CD) pipelines...