[Ubuntu] When characters repeats with tab autocompletion, fix the Locale

1 minute read

This article introduces a solution when a character duplication occurs, when one types tab for completion. For me, this usually occurs when I run a Ubuntu docker image in which locale is not configured.

In a docker container:

$ sudo apt-get update
$ sudo apt-get install locales
$ locale-gen en_US.UTF-8
$ dpkg-reconfigure locales

select en\_US.UTF-8 UTF-8

$ dpkg-reconfigure keyboard-configuration
$ localedef -i en_US -c -f UTF-8 en_US.UTF-8

commit the image (example):

$ docker commit -a "Junyong Lee" -m "tf1.10.0" junyonglee_tf codeslake/tensorflow-1.10.0:latest

When you run the image, run with the option -e LNAG=en_US.UTF-8:

$ nvidia-docker run --privileged -it -v /home/junyonglee:/root -v /Jarvis:/root/Jarvis -v /Mango:/Mango -v /Mango:/root/Mango -p 7001-7004:7001-7004 -e LNAG=en_US.UTF-8 --name junyonglee_tf --rm codeslake/tensorflow-1.8.0:latest /bin/zsh