1.30.2012

Redhat: RPM commands

Installing a RPM
# rpm -ivh package-1.0-2.i386.rpm

Note: this installs the rpm package, version 1.0-2, i386 architecture 


Removing a RPM
# rpm -ev package

Display information about a package
# rpm -qi setup-2.5.37-1.3
Name : setup Relocations: (not relocatable) Version : 2.5.37 Vendor: Red Hat, Inc. Release : 1.3 Build Date: Mon 20 Jun 2005 04:40:37 PM EDT Install Date: Thu 15 Feb 2007 09:28:36 AM EST Build Host: decompose.build.redhat.com Group : System Environment/Base Source RPM: setup-2.5.37-1.3.src.rpm Size : 37056 License: public domain Signature : DSA/SHA1, Thu 30 Jun 2005 01:27:57 PM EDT, Key ID 219180cddb42a60e Packager : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla> Summary : A set of system configuration and setup files. Description : The setup package contains a set of important system configuration and setup files, such as passwd, group, and profile.


Display file associated with a package
# rpm -ql setup-2.5.37-1.3 
/etc/aliases 
/etc/bashrc 
/etc/csh.cshrc 
/etc/csh.login 
/etc/environment 
/etc/exports 
/etc/filesystems 
/etc/group 
/etc/host.conf 
/etc/hosts.allow 
/etc/hosts.deny 
/etc/inputrc 
/etc/motd 
/etc/passwd 
/etc/printcap 
/etc/profile 
/etc/profile.d 
/etc/protocols 
/etc/securetty 
/etc/services 
/etc/shells 
/usr/share/doc/setup-2.5.37 
/usr/share/doc/setup-2.5.37/uidgid


Locate which rpm a file comes from
# rpm -qf /etc/passwd 
setup-2.5.37-1.3


Display all installed packages
# rpm -qa|more 
basesystem-8.0-4 
beecrypt-3.1.0-6 
expat-1.95.7-4 
....

No comments: