5 ms·
There's another thing about apt that's bothered me: apt-cache search isn't a very good search engine. Its most common use case is finding the exact name of some
by jimrandomh 11y ago
There's another thing about apt that's bothered me: apt-cache search isn't a very good search engine. Its most common use case is finding the exact name of some library/framework package, ie, "apt-cache search someframework". For common frameworks, this produces hundred of search results for packages that use the framework and mention this in their description, while the framework itself is in the list but very difficult to find. The --names-only flag fixes this, but it's not the default so it's one more thing to worry about.
- matt_wulfeck 11y agoI have this problem too. If I did myself shelling out to grep with pcre flags to find a simple library then there's a UX issue.
- dsl 11y ago> If I find myself shelling out to grep with pcre flags, I am using unix pipes as intended Fixed that for you.
- davvolun 11y agoHmm...except that I would guess search should do one thing well -- searching. Which, incidentally, using --name-only and/or regex, it does.
- iam-TJ 11y agoSearch uses regular expressions so generally no need for grep unless you need more complex filters; --names-only has the -n short-form: apt-cache search -n <regexp> More generally apt-get and apt-cache are designed to be backward-compatible for use in scripts whereas apt is not[0]: SCRIPT USAGE AND DIFFERENCES FROM OTHER APT TOOLS The apt(8) commandline is designed as an end-user tool and it may change behavior between versions. While it tries not to break backward compatibility this is not guaranteed either if a change seems beneficial for interactive use. [0] http://manpages.ubuntu.com/manpages/xenial/en/man8/apt.8.html http://manpages.ubuntu.com/manpages/xenial/en/man8/apt.8.htm...
- matt_wulfeck 11y agoGreat tip thank you!