October 5, 2022

Check package availability in the repository of a Linux’s distribution from the command-line

You can check whether a package (programme) is available in the repository of a Linux distribution by running:

$ apt-cache search <keyword>

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

The standard output of the command (i.e. the list of result) may be quite long. To facilitate going through the list, you can pipe the output to the programme less i.e. $ apt-cache search | less. Then you can use keys k and j to go up or down one line; q to quit less.

From apt-cache’s manual:

search performs a full text search on all available package lists for the POSIX regex pattern given, see regex(7). It searches the package names and the descriptions for an occurrence of the regular expression and prints out the package name and the short description, including virtual package names. If –full is given then output identical to show is produced for each matched package, and if –names-only is given then the long description is not searched, only the package name and provided packages are. Separate arguments can be used to specify multiple search patterns that are and’ed together.

If you would like to find out more about apt-cache or see more options, run

$ man apt-cache

command-line linux trisquel personal computing

No affiliates, No Google Analytics, No Facebook Pixel. © 2016-2022. Content is licensed under a CC BY-NC-SA 4.0.