When I work inside thin LXC container on 12.04 I have only very basic system. In particular the /etc/bash_completion.d is missing the e.g. apt, that I find particularly useful.

Is there any standard package, that installs the autocompletion for the apt, or should I copy the file manually? And just copying the files into /etc/bash_completion.d manually just doesn't seem to work.

I use bash as my command interpreter.

What am I missing here?


OK, I found the problem.

There are 4 essential things required for auto completion:

  1. Bash
  2. Executable script /etc/bash_completion (this is the part I was missing)
  3. Not-executable scripts in folder /etc/bash_completion.d. I believe they get installed silently together with the associated packages.
  4. Execution of the script /etc/bash_completion within the Bash (the standard ~/.bashrc takes care of that)
  • You can mark your own answer as the right answer. – OrangeTux Oct 27 '12 at 12:32
  • @OrangeTux I will... But "You can accept your own answer in 2 days" - says AskUbuntu.com – Adam Ryczkowski Oct 27 '12 at 12:43
  • Of course, I forgot that. – OrangeTux Oct 27 '12 at 13:26
  • 3
    The script /etc/bash_completion comes with the package bash-completion: apt-get install bash-completion – davitenio Aug 22 '14 at 12:12

Are you even runnning Bash?

Try bash. Does something@somewhere ~:$ appear and is autocompletion reanebled? If so set default bash by chsh /bin/bash.

More information in this answer.

  • Yes I run bash, but it is a good remark. – Adam Ryczkowski Oct 27 '12 at 9:52
  • I believe you forgot the command argument. Should be: chsh -s /bin/bash. Otherwise chsh tries to find user /bin/bash... – Adam Ryczkowski Oct 27 '12 at 9:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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