0

I have installed Kali Linux v1.1.0 (Debian based).
Filename completion for sudo was not running at the beginning, so I added:

complete -c sudo

And everything seems to autocomplete now, except for some packages in the apt-get package manager. If I type:

$ sudo apt-get install lubuntu-des

... and I press TAB :

$ sudo apt-get install lubuntu-desktop

... the package name "lubuntu-desktop" is autocompleted.

But if I type:

$  sudo apt-get install hwi

... this time TAB does not autocomplete to hwinfo as it must, even when the package does exist on the repos. If I complete the word manually:

~$ sudo apt-get install hwinfo
Reading package lists... Done
Building dependency tree
Reading state information... Done
hwinfo is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 39 not upgraded.

I have checked this behavior in another machine running Kali Linux too, and the autocompletion works OK for every package.

This is really nagging, as long as, if autocompletion works only sometimes, you can not know if a requested package does really exist in the repositories.

A strange behavior. This line:

sudo nano /etc/apt/sourc

autocompletes to:

sudo nano /etc/apt/sources.list.d/

even when the /etc/apt/sources.list file exist.

This is inside my ~/.bashrc and /etc/bash.bashrc :

if ! shopt -oq posix; then
  if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi
fi

but not inside my /etc/profile.

Why is this happening and how can I solve it?

EDIT-01: Tested adding complete -c sudo to ~/.bashrc. Still not solved.

EDIT-02: It seems there is no difference between installed or not installed programs. The package partimage is not installed, and does not autocomplete with TAB.

  • Do you have lubuntu-desktop package installed? – Braiam May 12 '15 at 1:51
  • @Braiam: No, it is not. – Sopalajo de Arrierez May 12 '15 at 1:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.