30

I do know http://packages.debian.org/ provide the search facillity.

The problem is how could I search the packages with just command line?

1
  • 2
    +: to search installed packages use 'dpkg -S regex'.
    – Jichao
    Nov 4, 2009 at 12:34

6 Answers 6

37

The apt-cache search command will return all packages that have name in the package name or description:

apt-cache search name

Once you have a package name, you can get more detailed information on the package using the apt-cache show and apt-cache showpkg commands.

apt-cache show package_name
apt-cache showpkg package_name
3
  • 3
    +: apt-cache search --names-only search only the package names.
    – Jichao
    Nov 4, 2009 at 12:22
  • +: 'apt-cache show package_name' display package metadata,e.g,version,name,source,arch,size and 'apt-cache showpkg package_name' mainly show the version,and the very detailed forwad/reverse dependencies.
    – Jichao
    Nov 4, 2009 at 12:33
  • apt list package_name is even easier; apt search query_string if you want to search for all instances of a given string in the package database.
    – may
    Feb 23, 2019 at 21:23
3

apt-cache search

1
  • +1 This is the one. It'll search descriptions as well as names, and isn't as bloated (or as incorrect) as some of the other solutions mentioned.
    – Lee B
    Oct 25, 2009 at 10:23
1

While both aptitude and apt-cache do the job well, there is a new kid on the block; axi-cache.

axi-cache works a lot like apt-cache, but on steroids. ;) It uses a sophisticated tool called xapian to build an index and then queries that index. It bundles something called http://wiki.debian.org/Debtags>debtags in with the index as well. Debtags allow you to create little tags that stick to deb packages. Suffice it to say that debtags are a powerful way to search for packages and tools to get stuff done.

For example, if you wanted a WebDAV client in Debian you could do this;

axi-cache search protocol::webdav

That search produces this on my machine;

axi-cache search protocol::webdav
14 results found.
Results 1-14:
100% gstreamer0.10-gnomevfs - GStreamer plugin for GnomeVFS
100% sitecopy - A program for managing a WWW site via FTP, DAV or HTTP
100% davfs2 - mount a WebDAV resource as a regular file system
100% blosxom - light, feature-packed weblog app with plugin extensibility
100% lighttpd-mod-webdav - WebDAV module for lighttpd
100% nd - small command line interface to WebDAV servers
100% cadaver - command-line WebDAV client
100% subversion-tools - Assorted tools related to Subversion
100% libapache2-svn - Subversion server modules for Apache
100% libcommons-vfs-java - Java API for accessing various filesystems
100% subversion - Advanced version control system
100% eldav - interface to the WebDAV servers for Emacs.
100% libhttp-dav-perl - WebDAV client library for Perl, and "dave" CLI client
100% fusedav - filesystem to mount WebDAV shares
More terms: webdav servers authoring versioning files subversion remote
More tags: network::client protocol::http role::program implemented-in::c interface::commandline protocol::ftp devel::rcs

As you can see a lot of tools show up which is quite handy if you're not really sure what you are looking for but you know for example the problem area you're looking at.

0

Install aptitude, them it's just aptitude search xyz for a list of packages with xyz in their name or one-line description.

0
sudo apt list package_name
sudo apt search text_to_search_for_in_all_package_fields
-1

As root:

apt-get search <package name>

If you didn't know about this, it is usually a good idea to run:

command --help

to see how you can you use the command. that or look at the man pages using

man <command>
4
  • @Jonno_FTW:Actually,I heard and used this command the other day.But it gave me too many result.So I have thougth there were any other splendid command...
    – Jichao
    Oct 25, 2009 at 8:59
  • 1
    you could always pipe it through less - apt-cache search | less
    – Journeyman Geek
    Oct 25, 2009 at 9:32
  • @Jonno_FTW:tired the apt-get search,shell returns invalid option.tried man apt-get ,could not find search option.googled,found nothing about apt-get.it seems we could not use apt-get search to search for packages!
    – Jichao
    Nov 3, 2009 at 12:50
  • You don't need to be root to use apt-cache search <part of package name>. I don't know of an apt-get search, however. That returns an error. Jan 14 at 20:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .