Search for a package using the APT-CACHE command in Linux

Home > Search > Linux commands
  by

apt-cache search package_name searchs the aptitude repository and displays any package that contains the keyword being used. For example, apt-cache search httpd shows any package that contains "httpd". Only a single line of output will be display for each matching result.

[root@server1 ]# apt-cache search httpd
apache2-bin - Apache HTTP Server (binary files and modules)
apache2-mpm-event - transitional event MPM package for apache2
apache2-mpm-prefork - transitional prefork MPM package for apache2
apache2-mpm-worker - transitional worker MPM package for apache2
gunicorn - Event-based HTTP/WSGI serverjavascript-common - Base support for JavaScript library packages

 

Apt uses the /etc/apt/sources.list file to know what repositories should be used when using apt.

apt-cache show package_name shows detailed information about a package. Many lines of output will be displayed for each match. For example, apt-cache show httpd will provide a summary of the httpd package.

[root@server1 ]# apt-cache show httpd
Package: bind9
Priority: optional
Section: net
Installed-Size: 931
. . .

 


ALREADY INSTALLED PACKAGES

apt-show-versions package_name can be used to view the versions of already installed packages. If a package is not installed, package_name not installed will be displayed.

[root@server1 ~]# apt-show-versions httpd
httpd:amd64/trusty-updates 1.11.5-1ubuntu3 

 

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter in the box below so that we can be sure you are a human.




Comments