When I want to search a package which named 'z', aptitude find packages which contains 'z' in package name same as 'like' in SQL, so aptitude find a lots of packages.
How can I search packages which package named z?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
The pattern given to an aptitude search is a regex, so you can use that to find exact matches:
aptitude search '^z$'
When you know the exact package name, you are not really "searching". If you want to see if the package is available, you can use
apt-cache policy. The
aptitude front-end doesn't really have an equivalent to this, but you can do an
apt-cache policy z aptitude show z
If you want to find packages that contain a whole word (e.g. find perl, but not sooperlooper), you can include word boundaries in your search pattern:
$ aptitude search '\bperl\b'
Aptitude also supports a wealth of search terms, as described in the reference manual., which allow you to change where exactly it looks for your pattern. For example, to find a Perl for your system, try:
$ aptitude search "?exact-name(perl) ?architecture(amd64)"