Useful RPM command-line options to have at your fingertips
Posted : June 2, 2004 at 1:46 pm [America/Los_Angeles]

(prompt)>rpm -ivh blah-2.0-4.i386.rpm (install an RPM package)
(prompt)>rpm -ivh –nodeps blah-2.0-4.i386.rpm (install an RPM package, ignoring the dependency warnings)
(prompt)>rpm -ivh *.rpm (if you want to install a bunch of them in one go)
(prompt)>rpm -e blah-2.0-4.i386.rpm (uninstall an RPM package
(prompt)>rpm -e –nodeps blah-2.0.4.i386.rpm (uninstall an RPM package, ignoring the dependency warnings)
(prompt)>rpm -qa|grep -i blah (search the installed RPM packages and look for the ones which have ‘blah’ in the title)
(prompt)>rpm -qi blah (metadata about the package)
(prompt)>rpm -qil blah (metadata about the package, including all the files installed as part of the package)
However, my personal favorite is this sequence:
(prompt)>rpm -qf /etc/sysctl.conf
initscripts-7.31.9.EL-1
(prompt)>rpm -qil initscripts
This particular combination helps me learn a whole lot about a ‘file’ on my system. The first command (rpm -qf /etc/sysctl.conf) tells me which package the file belongs to and the second (rpm -qil initscripts) tells me everything I ever wanted to know (or not
) about the package. It actually is something I am using a lot as I work towards setting up my ServerMatrix box.
Of course, you could always use tools like apt-get, yum or even up2date if you wanted some of this to be automated. Which reminds me: Can I install and use yum along with up2date that comes standard with RHEL 3?
- Anand
Category: Application Development