Over the years I have grown used to the fact that when I search for a package on a debian based distro, then I use:
apt-cache search foo bar
The result was a list of all the packages which had the text ‘foo’ and ‘bar’ in the description.
Lately it has been discouraged to use apt-get and apt-cache, but one should rather use aptitude as this tool is more powerful.
It is more powerful, but it does not behave the same. So the following command:
aptitude search foo bar
would return any result where either ‘foo’ or ‘bar’ was in the package name, not the description.
Since I have gotten used to apt-cache way this is how I do it with aptitude:
aptitude search "~dfoo bar"
But! This command does not check package names. Package names are with ~n. Maybe someone out there can explain how I can combine the two correctly?