8

I wanted to find packages related to transmission, a BitTorrent client but couldn't find how to search package descriptions.

Why do this?

In certain cases, package names are not obvious; for instance a remote controll application for Transmission can be named transmission-remote-gtk (an older one) or transgui (more recent). The description of both packages includes transmission though. It would be practical to the non-aware user that I am, who expects other packages to have non-obvious names if there was a way to lookup package description instead.

On my system aptitude search looks up into package names only. On the other hand there's eix -S under Gentoo.

So how would I search packages by description under Debian? (I guess I can browse all available packages and grep the results. I expect a more appropriate method, of course hence my question.)


EDIT: Listing results by built-in commands aptitude and apt-cache

As suggested by Marco and MatthewRock there's aptitude search '~d<string>' and apt-get search. However the two appear to also include results that have nothing to do with the search string (on my system at least):

# aptitude search '~dtransmission'
p   atlc                          - calculateur de lignes de transmission arbitraires                  
p   atlc:i386                     - calculateur de lignes de transmission arbitraires                  
p   atlc-examples                 - Exemples pour le calculateur de transmission de ligne arbitraire   
p   between                       - game about consciousness and isolation  
p   between:i386                  - game about consciousness and isolation  
p   boinc-app-seti                - SETI@home application for the BOINC client                         
p   boinc-app-seti:i386           - SETI@home application for the BOINC client                         
p   boinc-app-seti-dbg            - debug symbols for SETI@home             
p   boinc-app-seti-dbg:i386       - debug symbols for SETI@home             
p   boinc-app-seti-graphics       - SETI@home application for the BOINC client (with graphics)         
p   boinc-app-seti-graphics:i386  - SETI@home application for the BOINC client (with graphics)         
p   ca-cacert                     - CAcert.org root certificates            
p   cstream                       - general-purpose stream-handling tool similar to dd                 
p   cstream:i386                  - general-purpose stream-handling tool similar to dd                 
p   cycle                         - programme de calendrier pour femme      
...

with aptitude or

# apt-cache search transmission
between - game about consciousness and isolation
boinc-app-seti - SETI@home application for the BOINC client
boinc-app-seti-dbg - debug symbols for SETI@home
boinc-app-seti-graphics - SETI@home application for the BOINC client (with graphics)
ca-cacert - CAcert.org root certificates
libcollada2gltfconvert-dev - COLLDADA to glTF conversion library -- development
cstream - general-purpose stream-handling tool similar to dd
freedv - Software Defined Radio (SDR)
glfer - program for reception and transmission of QRSS/DFCW signals
libgmetric4j-java - gmetric4j Ganglia metric transmission API
libgnuradio-noaa3.7.5 - gnuradio noaa satellite signals functions
hamfax - Receive/send radio facsimile transmissions with Soundcard/PTC-II
hylafax-server - Flexible client/server fax software - server daemons
hylafax-server-dbg - Debug symbols for the hylafax server
libijs-dev - IJS raster image transport protocol: development files
libijs-doc - IJS raster image transport protocol: documentation
ike-scan - discover and fingerprint IKE hosts (IPsec VPN Servers)
ion - NASA implementation of Delay-Tolerant Networking (DTN)
ion-doc - Interplanetary Overlay Network - examples and documentation
libion-dev - NASA implementation of Delay-Tolerant Networking (DTN) - development files
...

with apt-cache. The above even includes results which do not match "transmission" nor "trans". Weird indeed.

  • They do match; the search is on the fully description, not just the one-line summary. E.g., apt-cache show between gives a several paragraph description of between, including the line These things that appear are ugly and non-procedural: indecipherable transmissions bubbling up through static,… Personally I use apt-cache search transmission | grep -i transmission to solve this problem. Not sure if there is a better way. – derobert Sep 2 '15 at 15:42
  • Damn'it! That's all but obvious :-D . Isn't there a Debian idiom that distinguishes between what is picked by "~d" and the single line printed by aptitude that would limit searching to only the latter part? – user86969 Sep 2 '15 at 21:21
3

Use apt-cache:

apt-cache search packagename

This shows packages that apt considers related(many of them don't even include name of packge in both description and name).

If you only want packages that contain packagename in description or name, pipe with grep:

apt-cache search packagename | grep 'packagename'

BUT! Other tools for the rescue:

axi-cache search packagename

You can read more about axi-cache here. axi-cache sorts scores by relevance and shows you percentage of match, so it's more likely to give you the output you want. Looks like my new replacement for apt-cache.

axi-cache is part of apt-xapian package

  • Right. Strangely enough apt-cache search returns far more than those packages with the search expression in either the package name or description. It also lists packages neither of which name or description match. I guess that's where grep comes to the rescue. This is a strange behaviour though. – user86969 Sep 2 '15 at 14:44
  • 1
    @Nasha check out my update. Found new tool that is really better. – MatthewRock Sep 2 '15 at 14:48
  • Good! I used to prefer aptitude over apt-xxx and extras ... so far. Looks like a few additional tools doesn't hurt. – user86969 Sep 2 '15 at 14:50
  • Unfortunately axi-cache is not available under my Linux Mint version (Petra, 16). I'll keep it in mind by all means however! – user86969 Sep 2 '15 at 14:55
  • 1
    Woops! Turns out that package was already installed :-D . And it's definitely what I was looking for as it also sorts results by ranking. – user86969 Sep 2 '15 at 15:03
1

You can use aptitude with the ~d argument to search in the descriptions:

aptitude search '~d <string>' # e.g.
aptitude search '~d torrent'  # search for “torrent” in the description
  • Thanks for the aptitude hint. Strangely enough, just like apt-cache search I also get results which have nothing to do with transmission. And the off-topic results are not even the same between the two :-D. – user86969 Sep 2 '15 at 14:47
  • The search command doesn't search for relation with a given package but for the given string in the description. Please provide an example if you think it produces false results. – Marco Sep 2 '15 at 14:56
  • I can understand. But what about p gpstrans:i386 - communicate with a Garmin Global Positioning System receiver or p gap-trans-groups Database of transitive groups for GAP then? There are many other examples like this while I was searching for transmission, not just trans, which would make more sense. – user86969 Sep 2 '15 at 15:00
  • aptitude search '~d transmission' | grep gpstrans doesn't return anything on my system. I can't reproduce your problem with the provided information. – Marco Sep 2 '15 at 15:21
  • Then I deduce it's probably my own system (cache) that's become corrupt or so. Is it possible at all? – user86969 Sep 2 '15 at 15:27
1

The answer is apt-cache search transmission. It does return only packages whose description contains the specified substring. (Not necessarily the specified word, for example the command also matches “retransmission”.)

The string might not appear in the output of apt-cache search transmission because that only prints the first line of the description, whereas the search includes the whole description. To print full descriptions, run apt-cache --full search transmission.

Your Answer

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