Embee
Embee

Reputation: 161

/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)

I'm receiving the error in the title and I'm not sure why. I'm trying to run a docker container in Unraid. The dockerfile code is down below if anyone would like to critique.

ENV DEBIAN_FRONTEND=noninteractive \
LANG=en_US.UTF-8 \
LANGUAGE=en_US.UTF-8 \
LC_ALL=en_US.UTF-8 \
TERM=xterm \
TZ=:/etc/localtime \
PATH=$PATH:/usr/local/go/bin \
GOBIN=/go/bin \
APP=/go/src/smugmug-backup

RUN sed -e "/deb-src/d" -i /etc/apt/sources.list \
&& apt-get update \
&& apt-get install --no-install-recommends --yes \
    ca-certificates \
&& apt-get clean \
&& rm -rf /.root/cache \
&& rm -rf /var/lib/apt/lists/*

Upvotes: 16

Views: 38630

Answers (2)

рüффп
рüффп

Reputation: 5448

Unfortunately the anwser with dpkg-reconfigure is not working for a Docker image as it cannot be interactive when building docker images.

On my side I found (in this post on ubuntu SE) that adding the following line in a RUN command of my Dockerfile was resolving the bash warning:

RUN apt-get install -y language-pack-en-base

After that executing the command:

docker exec -it my-docker-image /bin/bash

was not giving the warning about LC_ALL variable anymore.

Upvotes: 1

attaboyabhipro
attaboyabhipro

Reputation: 1648

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

In the last step you, would see a text based UI, select en_US.UTF-8 by moving using up and down arrow and selecting via spacebar or typing its id, which is 159.

Upvotes: 33

Related Questions