Score:3

nala search: how to find exact package name match?

ph flag

I need to perform package name search with nala and I want only exact matches, so basically, when searching for package gimp I want to obtain only gimp but not gimp-data.

Input:

apt search -n ^gimp$

Result:

Sorting... Done
Full Text Search... Done
gimp/jammy,now 2.10.30-1build1 amd64 [installed]
  GNU Image Manipulation Program

Input:

nala search -n ^gimp$

Result:

Error: ^gimp$ not found.
Artur Meinild avatar
vn flag
Which version of `nala` are you using?
Harry avatar
ph flag
@ArturMeinild 0.11.1~bpo22.04.1.
Artur Meinild avatar
vn flag
Ok - see my answer below.
Score:2
vn flag

There was done a lot for the search part in the recent nala releases.

Version 0.12.0 fixed the end-of-text RegEx search pattern:

Search end-of-text regexp not finding matches

So if you update to this version or later, the query returns the expected results (here done for apt):

$ nala search -n ^apt$
apt 2.4.8 [Ubuntu/jammy main]
├── is installed
└── commandline package manager

For packages in the universe repository, make sure this is enabled, to be able to find packages included here. You then get the expected result for gimp as well:

$ nala search -n ^gimp$
gimp 2.10.30-1build1 [Ubuntu/jammy universe]
└── GNU Image Manipulation Program

For the RegEx explained, the character ^ indicates the beginning of the line and $ indicates the end of the line.

  • The search ^something$ will return something only.
  • The search ^something will return all matches that begin with something
  • The search something$ will return all matches that end with something
in flag
"Latest version" is 0.12.1, looks from the changelogs like this was fixed in 0.12.0?
Artur Meinild avatar
vn flag
You're right !
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.