Bootstrap FreeKB - Linux Commands - apt-cache (search for a package)
Linux Commands - apt-cache (search for a package)

Updated:   |  Linux Commands articles

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 

 

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


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