It's the same error as in several other posts, but none of the solutions work for me.
apt-get install ar<TAB><TAB>
and there's not auto-completion. I'm using an Ubuntu-Docker:
# # Ubuntu Dockerfile # # https://github.com/dockerfile/ubuntu # # Pull base image. FROM ubuntu:16.04 # Install. RUN \ sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \ apt-get update && \ apt-get -y upgrade && \ apt-get install -y build-essential && \ apt-get install -y software-properties-common && \ apt-get install -y byobu curl git htop man unzip vim wget openssh-server && \ rm -rf /var/lib/apt/lists/* RUN add-apt-repository main RUN add-apt-repository universe RUN add-apt-repository restricted RUN add-apt-repository multiverse RUN apt-get update #ArangoDB stuff RUN curl -OL https://download.arangodb.com/arangodb34/DEBIAN/Release.key && apt-key add - < Release.key RUN echo 'deb https://download.arangodb.com/arangodb34/DEBIAN/ /' | tee /etc/apt/sources.list.d/arangodb.list RUN apt-get install apt-transport-https RUN apt-get update # Set environment variables. ENV HOME /root # Define working directory. WORKDIR /root # Define default command. CMD ["bash"]
which is working.
At first I couldn't use any auto-complete at all. Enabling the sections in the .bashrc allowed me to get the
install, but now I'm stuck. What I did so far:
sudo apt-get update
sudo apt-get install bash-completion
Enabled this in the /etc/bash.bashrc:
# 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
In the .bashrc I enabled:
# enable programmable completion features (you don't need to enable # this, if it's already enabled in /etc/bash.bashrc and /etc/profile # sources /etc/bash.bashrc). if [ -f /etc/bash_completion ] && ! shopt -oq posix; then . /etc/bash_completion fi
Still, no changes. Is there something docker-specific I have to put into consideration?
Apparently it's a shell-issue. I installed
zsh it's working as supposed.
I don't like to have this as a solution as I still don't understand why the regular shell refuses to work.
I have read about enabling auto completion for apt-get install in docker (ubuntu 14.04) - but frankly I don't quite get what the OP was doing to make it work.