Archive

Posts Tagged ‘yum’

Search for a package containing a certain file

January 30th, 2013 No comments

Assumed you want to find the package that contains the shared object libGLU.so.1, e.g. because a binary is dynamically linked against it, and ldd tells you that the shared library requirements are not met. On Fedora (or any yum-type os) you’d run

$ yum whatprovides */libGLU.so.1

and yum would tell you, that mesa-libGLU comes with /usr/lib64/libGLU.so.1 which could fulfill your need (could because you could also be missing the i686 version of the package, depending on your binary).

The Ubuntu way of achieving the same thing:

$ apt-file search libGLU.so.1

And of course the corresponding package would be libglu1-mesa on any recent Ubuntu os.

Categories: Uncategorized Tags: , ,

How to list rpm packages from certain repository

June 21st, 2012 No comments

Usually, rpm --queryformat can be used to generate all sorts of rpm package listing. You could, for example, use the vendor tag to separate the packages that are tagged with RPM Fusion from the list of all installed packages (rpm -qa):

$ rpm -qa --queryformat "%{Name}:%{Vendor}\n" | grep -F "RPM Fusion"

Unfortunately, there is no 1:1 mapping between rpm’s vendor tag and the install repository. In some cases, the vendor tag is just slightly altered (upper case letters, etc.) or the tag is completely empty.

And there is obviously no rpm tag for repositories, since rpm itself doesn’t know anything about repositories (you can list all available tags by invoking rpm --querytags). But of course, yum does!
To get a list of packages from the RPM Fusion repository, you can use

$ yum list installed | grep -i fusion

Resources:
http://unix.stackexchange.com/questions/22560/list-all-rpm-packages-installed-from-repo-x
http://www.rpm.org/max-rpm/s1-rpm-query-parts.html

Categories: Uncategorized Tags: , ,

Remove the last n installed packages with yum

February 6th, 2011 No comments

For n equals 13

yum remove `tail -n 13 /var/log/yum.log | cut -d \  -f 5`

See also cut manpage, tail manpage

Categories: Uncategorized Tags: ,

Installing yum build dependencies with yum-builddep

August 14th, 2010 No comments

After fiddling around with rpmbuild for quite a while, I stumbled upon yum-builddep. It’s basically a tool to install all packages required to rebuild an RPM package from the SRPM. So if you want to install all “BuildRequires” mentioned in the spec file of a package, invoke

yum-builddep <package name>

The source RPM for the specified package must be available in the yum repository or it can be a local source RPM file.

yum-builddep itself it part of the yum-utils package. You can install it with yum

yum install yum-utils

See also yum-builddep manpage

Categories: Uncategorized Tags: ,

Visualizing rpm dependencies with Graphviz

July 16th, 2010 2 comments

Sometimes, rpm dependencies get rather complex. It’s not always easy for an rpm maintainer to keep track of the runtime requirements of his package and therefore, huge rpm dependency trees develop. And it’s even more difficult so see which packages get pulled by yum, because only a tiny part of those are actually listed as requirements in the spec file. The tree gets huge with recursion!

With rpmdep, there’s a small tool that will help you visualize those dependency trees. It’s part of Fedora’s rpmorphan-package, so you can easily pull it with yum:

# yum install rpmorphan

rpmdep itself is just a perl script, that walks down the rpm tree recursively. It can produce a Graphviz dot-file, which in turn can be used to make rather since pictures. For example,

$ rpmdep -dot firefox.dot firefox
$ dot -Tpng firefox.dot -o firefox.png

produces a complete rpm dependency tree for firefox. An exemplary picture (firefox’s dependencies in Fedora 13):

Click image for full size (1.6MB)

Graphvic can produce quite a few output formats. For an overview about all available commands, have a look at http://www.graphviz.org/doc/info/command.html.

Categories: Uncategorized Tags: ,

Dealing with .rpmnew and .rpmsave files

July 8th, 2010 No comments

When an upgrade includes changes to a default configuration file, the package will write either a .rpmnew or a .rpmsave file instead of overwriting the configuration file on your system. Which file a package creates is up to the discretion of the package maintainer.

From “Dealing with .rpmnew and .rpmsave files” By Bruce Byfield:

An .rpmnew file contains the new default configuration file and leaves your original configuration file untouched. By contrast, and .rpmsave file is a copy of your original configuration file, which has been replaced by the new default file.

The following script can be helpful to find (and possibly merge) those files with your original configuration

for a in $(find /etc /var -name '*.rpm?*'); do diff -u $a ${a%.rpm?*}; done

You may also want to check on yum-merge-conf, a yum plugin to merge configuration files.

Categories: Uncategorized Tags: , , , ,