Say I want to uninstall the Dash item "Ubuntu Software Center".

To uninstall it via CLI, I have to know what the .deb package is called. So I apt-cache search ubuntu-software-center but the only thing that shows up is lubuntu-software-center.

I open Synaptic GUI program and search ubuntu-software-center and the first listing is what I want, called "software-center."

How can I get "software-center" to show up in the output of a apt-cache search command?


apt-cache search doesn't use a fancy full text search engine like Synaptic does, but simply prints all packages where your search words occur in the package name or description.

As neither the package name nor the description of software-center contains the word ubuntu-software-center a search using apt-cache will never find it that way.

However you can use multiple search words with apt-cache search and it will show you only the packages that contain all of them. So you can use e.g.

apt-cache search ubuntu software center

which gets you a short list a packages including software-center.

BTW, the apt-cache actually interprets the search words as regular expressions.

| improve this answer | |

From apt-get documentation, apt-cache search <search_term> will find packages that include <search_term>.

So if you want to get "software-center" to show up in the output of a apt-cache search command, you should try apt-cache search software-center.

Another related command can be dpkg -l *<search_term>* which will find packages whose names contain <search_term>. Similar to apt-cache search, but also shows whether a package is installed on your system by marking it with ii (installed) and un (not installed)

apt-cache search is a very rudimentary tool, basically implementing grep on package's descriptions. It often returns too many results or none at all when you include too many keywords.

axi-cache search <search_term>, on the other hand, provides better results, sorted by relevancy. It uses the Xapian search engine and is part of the apt-xapian-index package which indexes all package information. It knows about tags and returns results in a matter of milliseconds.

| improve this answer | |
  • I am aware of everything you said. All I have to go on is "ubuntu software center." I could spend all day trying "ubuntu-software-center" "ubuntu-software" "ubuntu-center" "software-center". You get the point. Or I could avoid this nonsense and open Synaptic and type "ubuntu-software-center" and get what I need. Is there a way to do this with apt-cache search? The <search_term> as used in apt-cache search is rather limited as compared to the output of Synaptic with the same search. – user308393 Nov 11 '14 at 16:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.