APT Package Management – How to Limit Search to Exact Match


I've been toying with Linux for quite some time now, but I never figured out this seemingly basal function of apt.

The thing is when searching for something related to Java or Python or something similar, apt finds hundreds of packages. But I want to limit the results to anything that has python as an exact name of the package.

So I tried stuff like:
apt search python | grep *python*
and so on, but never figured it out. I hate having to admit my defeat and result to webbased package details or using a graphical interface to find packets. Thanks in advance.

Best Answer

Apt supports regular expression, so you can use:

apt search ^python$

which looks for a package started with a p followed by ytho and ended to the n, (in other words: looks exactly for python).

or even limit your search to the package names using:

apt search --names-only python
Related Question