Skip to content
Tags

, ,

Managing RPM Packages

10/08/2011

I’ve read recently the following article on ServerWatch, where I found some advanced techniques for handling RPMs. Although I have no access to any RPM-based machine at the moment, nevertheless it is always useful to keep handy this information for future reference. If you want to see what package owns a file, you can use rpm -qf filename or the more informative rpmquery -f filename. rpmquery is usually a symbolic link to rpm, which corresponds to simply running rpm -q.

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 rpmquery -c packagename.

Of course, you can combine the previous two commands and find out the configuration files that come with a command (filename), without worrying about which package this command belongs to.

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.

Advertisements
Leave a Comment

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: