Some rpm quirks that can come quite handy sometimes. Specially for the ones who do not know how the rpm and spec files work :) .

The first one goes to a quick command which displays the top packages that use the most of your hard drive:

rpm -qa --qf="%{size} %{name}\n" | sort -n

This will list all installed packages, sorting them by size. There are some limitations for that (for example, it does not works nicely with hard links), but it gives you a big picture.

The second one goes to the:

rpm -qf /path/to/some/file

This will display which package the file you are looking at belongs to.

The third complements the third, and it is:

rpm -Vf /path/to/some/file

It will discover to what package the file belongs to, and verify if this package was changed since the install. So if something suddenly stopped working, and you are unable to figure out why by looking at the configuration file, this could come handy.

Next one goes to:

rpm -qf --scripts /path-to-some-file

If you notice that some command gets executed right after a package is installed, and the only thing you know about this package is one file it provides, this will show all such commands.

Fifth is:

rpm -qa --qf '%{license}\n' | sort | uniq

This will show you all the licenses of all packages you have installed on the system.

And a bonus one goes to:

rpm -qf --changelog /path/to/a/file

which shows the whole package changelog for the package that contains a specific file. This helps you find someone to blame when a package stops working :) .

I just packaged the gource package for Mandriva Cooker, so therefore it will be available in Mandriva 2010.1 – which will be released in just few weeks.

While doing so, I was playing a bit with it, and it is an impressive piece of software. I often receive comments asking about “who is really working on Mandriva-specific software”. So, just to illustrate it in details, here goes a detailed explanation of who had commited something into drakx-net (Mandriva network stack) over the past year and half:

The command to generate this video was (inside drakx-net source directory, checked out with git):

gource -640x360 -s 0.1 --stop-at-end --disable-progress --output-ppm-stream - | \
ffmpeg -y -b 3000K -r 60 -f image2pipe -vcodec ppm -i - drakx-net.mp4
© 2012 Eugeni's blog Suffusion theme by Sayontan Sinha