aptitude install autocompletion sugests packages that are installed/not installable

Bug #299912 reported by karaluh on 2008-11-19
This bug affects 2 people
Affects Status Importance Assigned to Milestone
bash-completion (Ubuntu)

Bug Description

Binary package hint: bash-completion

Intrepid, when pressing tab twice after sudo aptitude install yakuake I've got two sugestions: yakuake and yakuake-kde4, yakuake is installed. I also am able to autocomplete kregexpeditor which is not in repositories.

Trey Brown (trey.brown) wrote :

I can confirm this bug with the examples given by Karaluh

Changed in bash-completion:
status: New → Confirmed
Markus Edholm (markusedholm) wrote :

I'm not sure if I would want apt-get install autocompletion to skip installed packages.. after all..
"sudo apt-get install yakuake --reinstall"
is a valid command.

The issue with autocompletion of not installable packages might be because "apt-cache pkgnames", which is the where the package names come from, lists not only installable packages but also package names that it finds in the depends- and suggests-fields. It is possible to get rid of some of these not installable packages by changing the file
/etc/bash_completion, line 2135 from
  COMPREPLY=( $( apt-cache pkgnames $cur 2> /dev/null ) )
  COMPREPLY=( $( apt-cache pkgnames -o Apt::Cache::Allnames=false $cur 2> /dev/null ) )

I'm not sure if this change comes with any bad side effects.. I'm using it on my system right now and I haven't noticed anything bad so far.

(Line numbers and such is taken from my machine running ubuntu 9.04 64bit)

karaluh (karaluh) wrote :

The bug is about aptitude, not apt-get. Aptitude syntax would be aptitude reinstall yakuake, so my point is still valid.

Markus Edholm (markusedholm) wrote :

Bah, you're right.. sorry.. it's line 2302 in /etc/bash_completion then.. but you would have to separate the install command from the others on the same line (show and others).

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

Other bug subscribers