1

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?

2 Answers 2

7

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)
4
  • You can mark your own answer as the right answer.
    – OrangeTux
    Oct 27, 2012 at 12:32
  • @OrangeTux I will... But "You can accept your own answer in 2 days" - says AskUbuntu.com Oct 27, 2012 at 12:43
  • Of course, I forgot that.
    – OrangeTux
    Oct 27, 2012 at 13:26
  • 3
    The script /etc/bash_completion comes with the package bash-completion: apt-get install bash-completion
    – davitenio
    Aug 22, 2014 at 12:12
3

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.

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .