Using apt-cache to search for packages

Written by
Date: 2015-03-22 07:24:32 00:00

How to search for package on Debian or Ubuntu using command line apt?

When you want to install packages on your Debian or Ubuntu box, but you do not know the complete name of the packages you want to install, then you can get help from apt-cache command.

apt-cache performs a variety of operations on APT's package cache. apt-cache does not manipulate the state of the system but does provide operations to search and generate interesting output from the package metadata.

This packages is installed by default on your Debian and Ubuntu servers, so you just need to use it:

Let's say you need to install php modules, you can find them using.

apt-cache search php

That will list all packages related to php, to refine the search a little bit, use grep

apt-cache search php | grep php-

Now it will only list the packages with php- on the name.

In my Ubuntu 14.04 it was something like this:

php-pear - PEAR - PHP Extension and Application Repository
pkg-php-tools - various packaging tools and scripts for PHP packages
cakephp-instaweb - Development webserver for CakePHP applications
cakephp-scripts - MVC rapid application development framework for PHP (scripts)
doctrine - transitional dummy package for php-doctrine-orm
kdevelop-php-dbg - debugging symbols for the KDevelop PHP plugin
kdevelop-php-docs - PHP documentation plugin for KDevelop
kdevelop-php-docs-l10n - localization files for KDevelop PHP documentation plugin
kdevelop-php-l10n - localization files for KDevelop PHP plugin
libphp-adodb - ADOdb database abstraction layer for PHP
libphp-cloudfusion - A php toolkit for popular cloud computing services
libphp-jabber - Object-oriented PHP interface for the Jabber/XMPP protocol
libphp-jpgraph - Object oriented graph library for php5
libphp-jpgraph-examples - Object oriented graph library for php5 (examples)
libphp-magpierss - provides an XML-based RSS parser in PHP
libphp-pclzip - zip archive manager class for PHP
libphp-phpmailer - full featured email transfer class for PHP
libphp-predis - Flexible and feature-complete PHP client library for the Redis key-value store
libphp-serialization-perl - Perl module to manipulate serialized PHP data structures
libphp-simplepie - RSS and Atom feed parsing in PHP
libphp-snoopy - Snoopy is a PHP class that simulates a web browser
libphp-swiftmailer - component-based library for sending e-mails
mlmmj-php-web - web interface for mlmmj, written in php
mlmmj-php-web-admin - administrative web interface for mlmmj, written in php
php-apc - APC User Cache for PHP 5 (transitional package)