what option can be added to the rpm command in order to query packages
RPM (Red Hat Parcel Manager) is an default open source and most pop package management utility for Red Hat based systems like (RHEL, CentOS and Fedora). The tool allows system administrators and users to install, update, uninstall, query, verify and manage organisation software packages in Unix/Linux operating systems. The RPM formerly known every bit .rpm file, that includes compiled software programs and libraries needed past the packages. This utility only works with packages that built on .rpm format.
This article provides some useful twenty RPM command examples that might be helpful to you lot. With the aid of these rpm command you tin managed to install, update, remove packages in your Linux systems.
Some Facts about RPM (RedHat Package Managing director)
- RPM is free and released nether GPL (General Public License).
- RPM keeps the information of all the installed packages under /var/lib/rpm database.
- RPM is the simply style to install packages under Linux systems, if you've installed packages using source lawmaking, and then rpm won't manage information technology.
- RPM deals with .rpm files, which contains the bodily information about the packages such as: what it is, from where it comes, dependencies info, version info etc.
In that location are 5 bones modes for RPM control
- Install : It is used to install any RPM package.
- Remove : Information technology is used to erase, remove or united nations-install whatsoever RPM package.
- Upgrade : It is used to update the existing RPM package.
- Verify : It is used to verify an RPM packages.
- Query : It is used query whatever RPM package.
Where to discover RPM packages
Below is the list of rpm sites, where y'all can observe and download all RPM packages.
- http://rpmfind.net
- http://www.redhat.com
- http://freshrpms.internet/
- http://rpm.pbone.cyberspace/
Read Besides :
- 20 YUM Control Examples in Linux
- 10 Wget Control Examples in Linux
- xxx Virtually Useful Linux Commands for System Administrators
Please remember you must exist root user when installing packages in Linux, with the root privileges you tin manage rpm commands with their appropriate options.
i. How to Check an RPM Signature Parcel
Always bank check the PGP signature of packages before installing them on your Linux systems and brand sure its integrity and origin is OK. Use the post-obit command with –checksig (bank check signature) option to check the signature of a package chosen pidgin.
[[e-mail protected]]# rpm --checksig pidgin-2.seven.9-v.el6.2.i686.rpm pidgin-two.7.9-5.el6.2.i686.rpm: rsa sha1 (md5) pgp md5 OK
ii. How to Install an RPM Parcel
For installing an rpm software package, use the following command with -i option. For example, to install an rpm package chosen pidgin-2.vii.nine-5.el6.ii.i686.rpm.
[[electronic mail protected]]# rpm -ivh pidgin-2.seven.9-v.el6.ii.i686.rpm Preparing... ########################################### [100%] 1:pidgin ########################################### [100%]
RPM command and options
- -i : install a package
- -v : verbose for a nicer display
- -h: print hash marks every bit the package archive is unpacked.
3. How to cheque dependencies of RPM Parcel earlier Installing
Allow's say you would like to exercise a dependency cheque before installing or upgrading a parcel. For instance, utilize the following command to check the dependencies of BitTorrent-five.2.two-1-Python2.4.noarch.rpm packet. It will brandish the list of dependencies of package.
[[electronic mail protected]]# rpm -qpR BitTorrent-five.2.ii-1-Python2.4.noarch.rpm /usr/bin/python2.4 python >= two.3 python(abi) = 2.4 python-crypto >= 2.0 python-psyco python-twisted >= 2.0 python-zopeinterface rpmlib(CompressedFileNames) = 2.half-dozen
RPM control and options
- -q : Query a package
- -p : List capabilities this package provides.
- -R: List capabilities on which this package depends..
4. How to Install a RPM Package Without Dependencies
If y'all know that all needed packages are already installed and RPM is only existence stupid, you can ignore those dependencies by using the choice –nodeps (no dependencies cheque) before installing the package.
[[email protected]]# rpm -ivh --nodeps BitTorrent-5.2.two-i-Python2.four.noarch.rpm Preparing... ########################################### [100%] 1:BitTorrent ########################################### [100%]
The above control forcefully install rpm package by ignoring dependencies errors, only if those dependency files are missing, and then the plan volition non work at all, until you install them.
5. How to check an Installed RPM Package
Using -q choice with package name, will show whether an rpm installed or not.
[[e-mail protected]]# rpm -q BitTorrent BitTorrent-five.2.2-1.noarch
6. How to List all files of an installed RPM package
To view all the files of an installed rpm packages, use the -ql (query list) with rpm control.
[[email protected]]# rpm -ql BitTorrent /usr/bin/bittorrent /usr/bin/bittorrent-panel /usr/bin/bittorrent-curses /usr/bin/bittorrent-tracker /usr/bin/changetracker-console /usr/bin/launchmany-panel /usr/bin/launchmany-curses /usr/bin/maketorrent /usr/bin/maketorrent-console /usr/bin/torrentinfo-console
7. How to List Recently Installed RPM Packages
Utilise the following rpm control with -qa (query all) option, volition list all the recently installed rpm packages.
[[e-mail protected]]# rpm -qa --final BitTorrent-five.two.ii-1.noarch Tue 04 Dec 2012 05:14:06 PM BDT pidgin-ii.7.9-5.el6.two.i686 Tue 04 Dec 2012 05:13:51 PM BDT cyrus-sasl-devel-2.1.23-13.el6_3.1.i686 Tue 04 December 2012 04:43:06 PM BDT cyrus-sasl-two.i.23-thirteen.el6_3.1.i686 Tue 04 Dec 2012 04:43:05 PM BDT cyrus-sasl-md5-2.one.23-xiii.el6_3.one.i686 Tue 04 December 2012 04:43:04 PM BDT cyrus-sasl-apparently-2.1.23-thirteen.el6_3.1.i686 Tue 04 Dec 2012 04:43:03 PM BDT
eight. How to Listing All Installed RPM Packages
Blazon the post-obit command to print the all the names of installed packages on your Linux system.
[[email protected]]# rpm -qa initscripts-ix.03.31-2.el6.centos.i686 polkit-desktop-policy-0.96-two.el6_0.i.noarch thunderbird-17.0-1.el6.remi.i686
9. How to Upgrade a RPM Package
If we want to upgrade any RPM package "–U" (upgrade) selection will be used. One of the major advantages of using this pick is that information technology will not only upgrade the latest version of any parcel, just it volition as well maintain the backup of the older package and then that in instance if the newer upgraded packet does not run the previously installed package can be used again.
[[email protected]]# rpm -Uvh nx-iii.v.0-2.el6.centos.i686.rpm Preparing... ########################################### [100%] 1:nx ########################################### [100%]
10. How to Remove a RPM Parcel
To un-install an RPM package, for example we use the bundle name nx, not the original package proper name nx-3.5.0-2.el6.centos.i686.rpm. The -eastward (erase) pick is used to remove package.
[[email protected]]# rpm -evv nx
11. How to Remove an RPM Package Without Dependencies
The –nodeps (Do not check dependencies) pick forcefully remove the rpm package from the organization. But keep in listen removing particular package may suspension other working applications.
[[email protected]]# rpm -ev --nodeps vsftpd
12. How to Query a file that belongs which RPM Package
Allow's say, you have list of files and you would like to observe out which package belongs to these files. For example, the following control with -qf (query file) pick volition show you lot a file /usr/bin/htpasswd is own by package httpd-tools-two.2.xv-xv.el6.centos.ane.i686.
[[electronic mail protected]]# rpm -qf /usr/bin/htpasswd httpd-tools-ii.2.15-15.el6.centos.1.i686
13. How to Query a Information of Installed RPM Parcel
Let's say yous accept installed an rpm parcel and want to know the information about the package. The following -qi (query info) option will print the available data of the installed parcel.
[[electronic mail protected]]# rpm -qi vsftpd Name : vsftpd Relocations: (non relocatable) Version : 2.2.2 Vendor: CentOS Release : 11.el6 Build Date: Fri 22 Jun 2012 01:54:24 PM BDT Install Date: Monday 17 Sep 2012 07:55:28 PM BDT Build Host: c6b8.bsys.dev.centos.org Group : Arrangement Environment/Daemons Source RPM: vsftpd-2.2.ii-11.el6.src.rpm Size : 351932 License: GPLv2 with exceptions Signature : RSA/SHA1, Mon 25 Jun 2012 04:07:34 AM BDT, Key ID 0946fca2c105b9de Packager : CentOS BuildSystem <http://bugs.centos.org> URL : http://vsftpd.beasts.org/ Summary : Very Secure Ftp Daemon Description : vsftpd is a Very Secure FTP daemon. Information technology was written completely from scratch.
14. Get the Data of RPM Package Before Installing
You have download a package from the internet and want to know the information of a package before installing. For example, the post-obit pick -qip (query info package) will print the information of a bundle sqlbuddy.
[[e-mail protected]]# rpm -qip sqlbuddy-1.three.iii-1.noarch.rpm Proper name : sqlbuddy Relocations: (not relocatable) Version : 1.3.three Vendor: (none) Release : ane Build Date: Wed 02 Nov 2011 11:01:21 PM BDT Install Date: (non installed) Build Host: rpm.bar.baz Group : Applications/Cyberspace Source RPM: sqlbuddy-1.three.3-i.src.rpm Size : 1155804 License: MIT Signature : (none) Packager : Erik M Jacobs URL : http://www.sqlbuddy.com/ Summary : SQL Buddy รข Web based MySQL administration Clarification : SQLBuddy is a PHP script that allows for spider web-based MySQL administration.
fifteen. How to Query documentation of Installed RPM Package
To get the list of bachelor documentation of an installed packet, use the following command with choice -qdf (query document file) will display the manual pages related to vmstat package.
[[email protected]]# rpm -qdf /usr/bin/vmstat /usr/share/dr./procps-3.2.8/BUGS /usr/share/doc/procps-iii.2.8/COPYING /usr/share/doc/procps-3.2.8/COPYING.LIB /usr/share/md/procps-iii.2.8/FAQ /usr/share/dr./procps-iii.2.8/NEWS /usr/share/dr./procps-3.2.8/TODO
16. How to Verify a RPM Package
Verifying a package compares information of installed files of the package confronting the rpm database. The -Vp (verify packet) is used to verify a package.
[[e-mail protected] downloads]# rpm -Vp sqlbuddy-i.3.3-1.noarch.rpm S.five....T. c /etc/httpd/conf.d/sqlbuddy.conf
17. How to Verify all RPM Packages
Blazon the following control to verify all the installed rpm packages.
[[electronic mail protected]]# rpm -Va S.v....T. c /etc/rc.d/rc.local .......T. c /etc/dnsmasq.conf .......T. /etc/ld.and so.conf.d/kernel-2.half-dozen.32-279.5.2.el6.i686.conf S.5....T. c /etc/yum.conf Southward.5....T. c /etc/yum.repos.d/epel.repo
18. How to Import an RPM GPG key
To verify RHEL/CentOS/Fedora packages, y'all must import the GPG primal. To practise so, execute the post-obit command. It will import CentOS 6 GPG key.
[[email protected]]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-half dozen
19. How to List all Imported RPM GPG keys
To print all the imported GPG keys in your system, use the following command.
[[e-mail protected]]# rpm -qa gpg-pubkey* gpg-pubkey-0608b895-4bd22942 gpg-pubkey-7fac5991-4615767f gpg-pubkey-0f2672c8-4cd950ee gpg-pubkey-c105b9de-4e0fd3a3 gpg-pubkey-00f97f56-467e318a gpg-pubkey-6b8d79e6-3f49313d gpg-pubkey-849c449f-4cb9df30
twenty. How To rebuild Corrupted RPM Database
Sometimes rpm database gets corrupted and stops all the functionality of rpm and other applications on the system. So, at the time we need to rebuild the rpm database and restore it with the assist of following command.
[[electronic mail protected]]# cd /var/lib [[email protected]]# rm __db* [[email protected]]# rpm --rebuilddb [[email protected]]# rpmdb_verify Packages
Source: https://www.tecmint.com/20-practical-examples-of-rpm-commands-in-linux/
0 Response to "what option can be added to the rpm command in order to query packages"
Post a Comment