Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

apt-get install and apt-cache policy do not complete package names.

I have double checked /etc/bash.bashrc, no irregularities.

Googled for answers but none suffice.

Any help/advice?

share|improve this question
aptitude is not equal to apt. Which one is problematic? – Lekensteyn May 7 '12 at 9:44
Apologies. Apt commands in general. – beanaroo May 7 '12 at 9:50
Is completion set up for apt-get? complete -p apt-get – geirha May 8 '12 at 17:00
The result reads: 'complete -F _apt_get apt-get' Not sure what that means – beanaroo May 11 '12 at 14:44
up vote 7 down vote accepted

Actually, I found the solution ~

Install the auto-complete-el

sudo apt-get install auto-complete-el 

Install via the software center

After installing this package, I got everything back to normal.

share|improve this answer
100% - many thanks – beanaroo May 16 '12 at 10:47
It works, but I don't get why, the el stands for Emacs Lisp... – Gerhard Burger Jul 14 '14 at 9:29
Any ideas about autocompletion for apt itself? (as opposed to apt-get) – Robin Winslow Jan 26 '15 at 15:02

Open /etc/bash.bashrc with gedit or other text editor and uncomment the following lines:

#if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
#    . /etc/bash_completion

It works for me.

share|improve this answer
I can't find any /etc/bash.bashrc. You sure about that? – jokerdino Sep 22 '12 at 2:01

Is your shell prompt looking like $ instead of user@host:~$? If yes, then it could be case of wrong shell causing problem with autocompletion. Try changing login shell to /bin/bash from /bin/sh as below.

sudo chsh -s /bin/bash *username*
share|improve this answer
Dear Downvoter, please leave a comment helping me avoid repeating, the perceived mistake. – Kiran Mar 13 at 13:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.