Okay a college of mine just showed me that you could do
sudo apt-get install <type first letters of package> <TAB>
That it auto-completes the name of the package. Just for an example...
sudo apt-get install ged<TAB>
results in sudo apt-get install gedit
Now I tried to do this but this does not work for me.
How can I solve this? Do I have to install a package? My college told me that he didn't install anything extra for it.
Bash does support some more kinds of autocompletion, not only filename completion.
In the file /etc/bash.bashrc, you will find a paragraph, like this or similiar to this:
(this example is from debian, but is probably identical to the Ubuntu version)
By removing the
#
character in the beginning of each line you put a lot of additional completion rules into effect. (Don't remove the # on the first line... thats really a comment ;-)I believe apt-get completions are among those enabled with this. If not you could think about switching to zsh. I know they support it ;-)
I found that on mine this was happening because
bash-completion
was not installed for some reason. So this fixed it (12.04):I had the same problem after installing Ubuntu 15.10.
Reinstalling
bash-completion
worked for me :In Ubuntu it started to irritate me too, so I just did (in terminal):
and changed
into
now it works like I want it to again... HTH :)
It is different from the example Paul Hänsch gave, mine came from ubuntu 12.04. I am not sure what Pauls version would do exactly, maybe he could elaborate on that a bit?
Another issue can be a failed
apt-get update
. After removing the wrong sources, and runningapt-get update
, I got my autocomplete restored.Open a Terminal and
After I installed bash-completion, this issue is fixed in my side.
this happens to me when either:
I use my university pc where I can't use the autocomplete because am not a super user.
The ppa of the package that you are trying to download is not in your
source.list
. So the terminal can't recognize the package that you are trying to download.NOTE: This may not apply to everyone. Am just sharing my experience