apt-cache search --names-only gives many false positives

Bug #253761 reported by Jason Woofenden
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Confirmed
Undecided
Unassigned
Nominated for Hardy by Jim Salter
Nominated for Karmic by Jim Salter
Nominated for Lucid by Jim Salter

Bug Description

Binary package hint: apt

The manpage for apt-cache says that --names-only should "Only search on the package names, not the long descriptions."

And yet it frequently lists packages that do not have the search terms in the name or short description.

Example: (bash script)

for x in ab bc de ef
do
    echo
    echo "False positives for apt-cache search --names-only '$x':"
    apt-cache search --names-only $x | grep -iv $x
done

I get 99 false positives, attached is the output of the above script on my box.

I have ubuntu hardy, and I did "apt-get update" and "apt-get upgrade" a few days ago. I don't think this bug is new.

Revision history for this message
Jason Woofenden (jason210) wrote :
Jim Salter (jrssnet)
Changed in apt (Ubuntu):
status: New → Confirmed
Revision history for this message
Jarno Suni (jarnos) wrote :

The bug is present in Ubuntu 16.04; apt version 1.2.10 (amd64)

$ apt-cache search --names-only ab|grep -cv ab
100

Furthermore, the command does not restrict to the package names even if the option suggests it does.
The following script should print 0:

$ apt-cache search --names-only ab|cut -d' ' -f1|grep -cv ab
107

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.