March 6, 2014
by Juan A. Suárez
Hi again! Let me tell you something. I’m a Fedora user since several releases ago, probably since Fedora 13 or 14.
Before that, I was using Ubuntu, but decided to switch to Fedora for several reasons that are not worth explaining here. In any case, after switching to Fedora there was something that I was missing quite a lot: the aptitude package manager. aptitude is a
deb package manager, similar to apt. What I really like about aptitude is its flexibility when searching packages.
While apt or yum allows to specify the search term, they just get all the packages matching the search text, but they don’t allow you where to search. Do you want to get only packages that are not installed? Or do you just remember the package had python in the name, and part of the description? With aptitude this is not a problem, as it allows you to specify such search expressions.
Though search in yum is not so flexible, as far as I know, it has a nice feature: it allows plugins to implement new features. So several months ago I wrote a plugin to mimic the aptitude search flexibility: yum searchex (search extended).
It is worth saying that I didn’t want to imitate the full aptitude functionality; only those features that I really missed from Ubuntu.
The basic idea is specifying for each term where to search. This is done by prefixing the text with
~ and a letter that expresses where to search. In some cases, the text to search is not needed. For instance, to search only in the list of installed packages, we would use
The full list of the available options can be found in the project forge.
As an example is worth a thousand words, let’s show how to search a package that we know it contains python in the name, it is not installed, and also we remember it has something to do with KDE:
yum searchex ~apython~dKDE
Hope this plugin is as useful for you as it is for me!