Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

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

share|improve this question
1  
+: to search installed packages use 'dpkg -S regex'. –  Jichao Nov 4 '09 at 12:34

5 Answers 5

up vote 11 down vote accepted

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
share|improve this answer
2  
+: apt-cache search --names-only search only the package names. –  Jichao Nov 4 '09 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 '09 at 12:33

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

share|improve this answer

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>
share|improve this answer
    
@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 '09 at 8:59
1  
you could always pipe it through less - apt-cache search | less –  Journeyman Geek Oct 25 '09 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 '09 at 12:50

apt-cache search

share|improve this answer
    
+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 '09 at 10:23

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 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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