Debian does not come with 'bash-completion' installed and enabled.
To fix this, run (as root):
apt-get install bash-completion
Then, you have two options. You can either (1) enable it on a per-user basis for yourself, or (2) enable it globally.
If you want to enable it for just your user, edit ~/.bash_profile and ~/.bashrc - add the following:
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
To try it without logging out and back in, run:
. ~/.bashrc
Or open a new shell. Then try to use tab-completion with apt. That dot and space at the beginning (.
) is the same as using the source
keyword in bash, but is more portable.
If you want it to work when su
'd into the root account, do the same thing in root's home directory (typically /root
).
To enable it globally, do the changes from (1) in the file /etc/bash.bashrc
instead.