edit · print · PDF

Please note that all the SIEpedia's articles address specific issues or questions raised by IAC users, so they do not attempt to be rigorous or exhaustive, and may or may not be useful or applicable in different or more general contexts.

Tips on using rpms

Installing and Uninstalling Packages

  • How do I install a new package, or upgrade it if it already exists?
    rpm -Uvh package.rpm
  • If I have a directory containing updated packages, how do I upgrade only the ones currently on my system?
    rpm -Fvh *.rpm
  • How do I delete an installed package from my computer?
    rpm -e package

Querying Info from Packages

  • How do I see a list of all installed packages on my computer?
    rpm -qa | less
  • How can I see the architecture (32 bits, 64 bits, noarch, etc.) of the installed packages:
    Use the "--qf" flag, for instance (see rpm man page for details):
    rpm -qa --qf "%{name}-%{version}-%{release} %{arch}\n"
  • I don't know what a certain installed package does. How can I get it to tell me about itself?
    rpm -qi package
  • How do I ask what files were installed by a certain installed package?
    rpm -ql package
  • How do I get a-yet-uninstalled package to give me information about itself and the files it would install on my computer?
    rpm -qilp package.rpm
  • There's a file on my computer called /usr/bin/weirdo. How can I find out which installed package it belongs to?
    rpm -qf /usr/bin/weirdo
  • How do I find out which package installed /usr/bin/weirdo, AND how do I get information on that package and see all the other files it installed?
    rpm -qilf /usr/bin/weirdo
  • How do I get a list of all packages sorted by install time?
    rpm -q --all --last
    to reverse the order (most recent last)
    rpm -q --all --last | tac

Verifying Packages

  • I deleted a few files by accident, but I don't know what they are. Can rpm show me which files in its database are now missing?
    rpm -Va
  • I think I've been hacked! How do I check for files that have been modified or removed in any way?
    rpm -Va
  • "rpm -Va" takes a long time. How do I just verify that a certain package is OK?
    rpm -Vv package
  • How do I test the integrity of a yet-uninstalled package file?
    rpm -K --nopgp package.rpm

Building Source Packages

Making your own RPM's is beyond the scope of this quick reference (see the Maximum RPM book for that), but it's not unusual to want to build from RPM's that only contain source code, not binaries. This is especially relevant for non-Intel architectures like PowerPC, Alpha, and Sparc which may not have platform-specific RPM's available, only the source code RPM's.

  • I've downloaded an RPM package containing source code. How do I make a binary RPM out of it, and then install it?
    rpm --rebuild package.src.rpm, then
    rpm -Uvh package.rpm

Miscellaneous

  • How do I compress and rebuild my computer's RPM database?
    rpm --rebuilddb

Section: HOWTOs

edit · print · PDF
Page last modified on September 10, 2012, at 02:36 PM