17

Some (most?) packages in Debian, have tags. For example:

=# apt-cache show squirrelmail | perl -lne 'print if /^Tag:/.../^\S/'
Tag: implemented-in::php, interface::web, mail::imap, mail::smtp,
 mail::user-agent, network::server, protocol::http, protocol::imap,
 protocol::smtp, role::program, scope::application, use::browsing,
 use::editing, use::searching, use::transmission, use::viewing,
 web::TODO, web::application, works-with::mail
Section: web

But, I can't find a way, to list all packages with given tag. Is it possible?

0

4 Answers 4

8

You probably want to take a look at all the documentation surrounding Debtags. It's... not as simple as you might think. No, I don't know why, either.

2
  • 2
    Just a word of comment - I picked this answer, because debtags seems to do what I need (debtags search "mail::user-agent && interface::web") while axi-cache seems to have problems when searching for multiple tags at once.
    – user13185
    Jul 8, 2012 at 19:04
  • 1
    I have… had neither aptitude nor debtags installed… and I neither know why nor do I understand why and how apt(-cache) search doesn't/can't use tags. Debian… sometimes it annoys me very much. And has done so for over 20 years. Feb 21, 2023 at 4:22
14

I wonder why people haven't suggested:

aptitude search '?tag(protocol::dns)'

aptitude search allows complex search queries with probes on different package description fields and logical operators:

aptitude search '?tag(game::strategy) ?installed'
aptitude search '?tag(protocol::dns) !?installed'

Refer to Search term reference in Aptitude User's Manual from aptitude-doc-en package (/usr/share/doc/aptitude/html/en/index.html).

2
  • this does it very well
    – oliver
    Aug 29, 2018 at 10:34
  • aptitude search '?tag(section::games)' chess seems to list all chess games on Ubuntu... the reason I gave this example is that apt-cache show lists the section of an Ubuntu package. The command you just stated here enables us to search using those sections (I guess...(?)) :) Jul 16, 2019 at 17:42
6

Use axi-cache from the apt-xapian-index package. You can, for example do axi-cache search --all protocol::smtp. The tab-completion for axi-cache is extremely advanced, so hit tab often. For example, axi-cache search --all protocol::smtp <tab><tab> will show you what other tags you might want based on the fact that you already specified the first.

1
  • axi-cache is nice as we can mix and match keywords and tags. For example 'axi-cache search scanner suite::kde' will search packages with 'scanner' word and have 'suite::kde' tag. Feb 27, 2021 at 18:38
5

If you install debtags, you can use it to search for tags like this:

debtags search made-of::icons
debtags search "made-of::icons && x11::theme"
debtags tagcat               # Shows all tags and their description
debtags tagshow x11::TODO    # Shows a single tag plus description

debtags also comes with a nice bash tab completion.

You must log in to answer this question.