SHARE
Facebook X Pinterest WhatsApp

5 Tips for Managing RPMs

Written By
thumbnail Joe Brockmeier
Joe Brockmeier
Jun 20, 2011
ServerWatch content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More



Last week, I looked a couple of lesser-known features for working with Debian packages, using dpkg, apt-file and aptitude. This week, I want to look at a few things you can do when working with RPMs if you happen to be on a Fedora or RHEL-derived system.

Fedora or RHEL users working with RPMs will find these 5 little-known features to be of great value.

One thing you may want to do is to see what package owns a file. For this you’ll use rpm -qf filename. For example, if you want to know what package owns /usr/lib/libkonq.so.5 then you’d run rpm -qf /usr/lib/libkonq.so.5. On Fedora 15, the command would return kdebase-libs-4.6.3-1.fc15.i686.

Ever been confused about what configuration file or files exist for a package? It’s not unusual to install a package (or have a package installed as a default) and not know exactly what configuration files are used to manage it. To determine the configuration files installed with a package, use rpm -qc packagename. Then, to find out what configuration files exist for the gnome-vfs2 package, you’d use rpm -qc gnome-vfs2, which will return:

/etc/gnome-vfs-2.0/modules/default-modules.conf
/etc/gnome-vfs-2.0/modules/ssl-modules.conf

This tells you the files that go with the package, but what about a specific command? For that, combine the two options (cf) that go with the query command. So, to find out the configuration files that apply to the yum command, you’d use rpm -qcf yum. This will display:

/etc/logrotate.d/yum
/etc/yum.conf
/etc/yum/version-groups.conf

Note that not all commands have a configuration file. If you look for less, for example, you’ll get no results.

Wondering if the files installed by a package are still in the same state as they were when installed? The rpm -qs packagename command will display all of the files installed by the package with a notation of “normal,” “replaced,” “not installed” and so on. This can be useful in a number of situations — it may help detect an intrusion, or you can use this when you’re working on a client’s system and need to troubleshoot a problem. (This is also good for those clients that claim they’ve touched nothing, when you’re pretty sure they were tinkering before the system blew up.)

Finally, if you need to find a package that provides a dependency (like a library) use yum resolvedep dependency like so: yum resolvedep libz.so.1, which (on Fedora 15) will return 0:zlib-1.2.5-3.fc15.i686.

If you’re on SUSE or openSUSE, don’t fret — I’ll cover some tips and tricks for Zypper soon.

Joe ‘Zonker’
Brockmeier
is a freelance writer and editor with more than 10 years covering IT. Formerly the openSUSE Community Manager for Novell, Brockmeier has written for Linux Magazine, Sys Admin, Linux Pro Magazine, IBM developerWorks, Linux.com, CIO.com, Linux Weekly News, ZDNet, and many other publications. You can reach Zonker at jzb@zonker.net and follow him on Twitter.

Follow ServerWatch on Twitter

thumbnail Joe Brockmeier

Joe Brockmeier is the editorial director of the Red Hat Blog. He joined Red Hat in 2013 as part of the Open Source and Standards (OSAS) group, now the Open Source Program Office (OSPO). Prior to Red Hat, Brockmeier worked for Citrix on the Apache OpenStack project, and was the first OpenSUSE community manager for Novell between 2008-2010. Brockmeier also has an extensive history in the tech press and publishing, having been editor-in-chief of Linux Magazine, editorial director of Linux.com, and a contributor to LWN.net, ZDNet, UnixReview.com, and many others.

Recommended for you...

What Is a Container? Understanding Containerization
What Is a Print Server? | How It Works and What It Does
Nisar Ahmad
Dec 8, 2023
6 Best Linux Virtualization Software for 2024
What Is a Network Policy Server (NPS)? | Essential Guide
ServerWatch Logo

ServerWatch is a top resource on servers. Explore the latest news, reviews and guides for server administrators now.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.