Today Alexander Shopov was giving me some help because of a very severe problem I had here. The problem (already solved by magic – we did not noticed what exactly solved it) was that
rpm -qi kernel
was showing two kernel packages installed, but when I try to remove the older one, it was reporting that the package was not (?) installed. However, as I said – the problem was solved magically – after many tries, the last “rpm -e” command strangeously why succeeded.
However, this article is not about this. It’s about some nice rpm query commands that I want to remember. And the best way to remember them is to store them here :).
The first command to remember is:
rpm -qi <package name>
This command gives you valuable information about all installed package’s versions. If this this information is too much for you, and if you need the real package(s) names, in the way they should be given in probable “rpm -e” command, then you should use the second command to remember:
rpm -qa <package name>
This command enlists all packages with thie name (and their different versions). You may use the output as source of the “rpm -e” command later.
And during Alexander’s help, I learned the third command (mini-script) to remember:
for i in*; do echo -n "$i :: " && rpm -qf $i; done
If you run this mini script in given directory, it will list each file from that directory and the rpm, to which this file eventually belongs to. If the file does not belong to any rpm – you will have the corresponding message about it. Very useful thing indeed!
I would like to thank again to Alexander for all his time! I learned valuable things, and he also helped me (though I did not understood how finally it worked) to overcome my problem!