autocomplete not working on one sever, works on others

Posted by dogmatic69 on Server Fault See other posts from Server Fault or by dogmatic69
Published on 2011-03-14T23:05:14Z Indexed on 2011/03/15 0:11 UTC
Read the original article Hit count: 549

Filed under:
|
|

I have Ubuntu 10.10 x64 and x86 running on various servers and auto complete works on all of them bar one.

The issue: apt-<tab> would show a list of options but sudo apt-<tab> would not.

After fiddling with it for a few hours i've found that /etc/bash_autocomplete did not exist. on the broken server. Copying the one from a working one it now works. but still not properly.

sudo apt-get ins<tab> does not show do anything.

listing the files in /etc/bash_autocomplete.d/ on the working server has about 50 files, and the broken one only two or three.

i dont think that i can just copy these files though as it might show commands for things that are not even installed.

TL;DR

autocomplete broken, how can i fix it. Seems like its disabled somewhere, why is this

EDIT: Ok, it was not ever installed...

$ sudo apt-get install bash-completion
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed
  bash-completion
0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
Need to get 140kB of archives.
After this operation, 1,061kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ maverick-updates/main bash-completion all 1:1.2-2ubuntu1.1 [140kB]
Fetched 140kB in 0s (174kB/s)          
Selecting previously deselected package bash-completion.
(Reading database ... 23808 files and directories currently installed.)
Unpacking bash-completion (from .../bash-completion_1%3a1.2-2ubuntu1.1_all.deb) ...
Processing triggers for man-db ...
Setting up bash-completion (1:1.2-2ubuntu1.1) ...

its now kinda working, but still wonky... apt-get ins<tab> gives sudo apt-get insserv as the option. also apt-get install php5<tab> gives apt-get install php5/ not php5-* options.

© Server Fault or respective owner

Related posts about bash

Related posts about ubuntu-10.10