When working from the command line you may find that you are wanting to install a specific package for a certain task but do not know what that package is called. There is a way to search through the available packages or software from the repositories in the command line or terminal. This search tool is called apt-cache. This tutorial will show you the basic functions of the apt-cache command.
The first thing you may want to do is do a general search. This is done in the example shown below.
apt-cache search gnome
The above command will show you many results that may not even have the term gnome in the name of it. In order for the above command to return a package the word gnome can be included in the description or name.
If you decide that you want to search for a particular term and show results of packages that have the term in their name you can use the -n parameter as shown below.
apt-cache -n search gnome
The above command will only show you results that have “gnome” in the package name. It will return a result such as “telegnome” You can also use the “^” to symbolize “start” and the “$” to symbolize “end” this is shown in the two examples below.
apt-cache -n search ^gnome
This will return results such as “gnome radio”.
apt-cache -n search gnome$
This will return results such as “xchat-gnome”.
Once you have found the package that you want to install you can simply use the apt-get install command to do the installation.
If you have any questions or comments about how to use the apt-cache command in the terminal don’t hesitate to leave a comment below. Also, if you found this tutorial helpful please like and share so that other people will find this tutorial more easily.