How do I search for available packages from the command-line?

To search for a particular package by name or description:

From the command-line, use:

apt-cache search keyword

where the search keyword can be all or part of a package name or any words used in its description.

For example, apt-cache search proxy includes both these packages:

tinyproxy - A lightweight, non-caching, optionally anonymizing HTTP proxy
tircd - ircd proxy to the twitter API

Note: the list may be long, so you can pipe the output to less to make it scrollable one line or one screen at a time, i.e. apt-cache search something | less.

To get a list of ALL packages

apt-cache search .

Use Synaptic if you have X-forwarding enabled or are on a desktop

Synaptic is often a more convenient way to do this, but requires at least an X server on your end (unless you're running a desktop environment). Install with sudo apt-get install synaptic if necessary.

  • Synaptic on ssh'd server via X forwarding:

    enter image description here

  • Synaptic running locally on Ubuntu Desktop:

    enter image description here


Using aptitude, apt-cache, and apt all format the output differently. (None of these require the use of sudo when searching for a package.) I prefer using apt for its readability. It highlights the package name and puts a space between the different packages. It also has [installed] listed next to each package that is already installed. Usage:

apt search package-name

You can also use aptitude from the command line:

aptitude search xxxxxx