Ubuntu – apt-get auto complete not working

To fix apt-get auto complete issue we need to edit /etc/bash.bashrc file.

Open /etc/bash.bashrc file with any text editor, here I am using vim.

$ vim /etc/bash.bashrc

Now search for below lines in /etc/bash.bashrc file:

# enable bash completion in interactive shells
# 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

Uncomment external if condition(uncomment all line except first line), after uncomment it look like below:

# enable bash completion in interactive shells
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

Next save and exit /etc/bash.bashrc file and reopen terminal.

I got this issue after installing Ubuntu 14.04 64 bit desktop edition & and resolved it by following above mentioned procedure.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s