apt-cache search: Search available packages in the repositories
August 9th, 2024 12:39 PM Mr. Q Categories: Command
Command: apt-cache search
Used to search for packages available in the repositories configured on your system. This command queries the package cache and displays a list of packages that match the search criteria.
Sample Command and Output:
$ apt-cache search nginx
nginx - high-performance web server
nginx-core - nginx core engine
nginx-full - nginx web server (standard)
nginx-light - nginx web server (light)
Description:
apt-cache search <search_term>
: Searches for packages in the APT cache that match the specified search term. In the example,nginx
is used as the search term, and the command returns a list of packages related to Nginx.
Additional Commands and Sample Outputs:
apt-cache search <keyword>
: Search for packages related to a keyword. Sample Command and Output:
$ apt-cache search text editor
gedit - GNOME text editor
vim - Vi IMproved - enhanced vi editor
nano - small, friendly text editor
Description:
apt-cache search <keyword>
: Searches for packages related to the specified keyword (e.g., “text editor”). The command returns a list of packages whose descriptions contain the keyword.apt-cache search --names-only <package_name>
: Search for packages by name only. Sample Command and Output:
$ apt-cache search --names-only python
python - interactive high-level object-oriented language (default version)
python3 - interactive high-level object-oriented language (version 3)
Description:
apt-cache search --names-only <package_name>
: Searches for packages by name only, ignoring descriptions. This is useful when you want to find packages with names that match the specified term.
Note: apt-cache search
provides a quick way to find available packages and their descriptions. For more detailed information about a specific package, use apt-cache show <package_name>
.