How to use apt search: Simple Introduction for Ubuntu and Debian
apt search is a tool used in Debian-based Linux distributions (like Ubuntu) to search for packages in the system’s repositories. In this blog post I will show you how to use it.
Step 1: make sure to update your system, before we will do anything else:
# sudo apt update # sudo apt upgrade
Now we will use apt search to look for various software packages. Lets start by doing a search for the package named ‘zsh’.
# sudo apt search zsh
You will see lots of matches, that include matches in the file name and the description

So let us try to be a bit more accurate in our package search techniques with apt search. Try this command below:
# sudo apt search --names-only zsh
This is getting better, here is the output below:

Now lets try to find exactly the zsh program, with exact match:
# sudo apt search --names-only "^zsh$"
This uses the names-only option but also regular expressions to mention beginning of line and end of line should be right before and after zsh, here is the output with a single match.

Of course you can vary the regex expressions to your hearts content looking for the name of the program you are searching for. But what if you want to search only in the description of the package? There is no –description-only command so just use the default option and then use your regex. Here is an example:
# sudo apt search "zsh plugin"
Since we did not use names-only and we put spaces in the search term its not going to find program titles but find the matches in the text for “zsh plugin”. Here is the output on my system for this command:

Before we go, let me inform you of one more cool and useful feature of apt search, the -f command, which provides more full and detailed output and information about the matching packages. Try this out on your system, here is a screenshot on my system:

CONCLUSION
Mastering apt search and its various command-line options can significantly enhance your ability to navigate and manage software on Debian-based systems. Whether you’re looking for specific packages, exploring all versions of software, or searching within descriptions, the flexibility of apt search empowers you to find exactly what you need. Practice with these commands will make you adept at quickly locating the software you need from the vast repository of free and open-source software.