When setting up a Proxmox pct container with Ubuntu 20.04, it’s common to encounter a bash warning upon the initial SSH login. This warning typically appears due to a locale configuration issue within the container environment.

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

To address the issue, it is important to understand that the default locale is not set by default. To resolve this, we can follow a simple fix by generating a locale. The following example shows how I fix this for my particular locale.

sudo locale-gen en_US.UTF-8
sudo mv /etc/default/locale /etc/default/locale.old
echo "LANG=en_US.UTF-8" | sudo tee /etc/default/locale