5

I have created a chroot jail and when I log in I get a bash warning bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)

I tried to google the error, but wasn't able to find a solution

samwell
  • 339
  • 1
  • 6
  • 13

2 Answers2

8

Sounds like you're missing /usr/lib/locale inside your chroot. Try copying them into place from your non-chroot'd /usr/lib/locale or chroot with LANG=C.

yrk
  • 2,487
  • 17
  • 22
Travis Campbell
  • 1,466
  • 7
  • 15
0

While Travis Campbell's answer is certainly very valid, I found an alternative solution on my Debian Buster chroot that probably also works on Ubuntu. In the chrooted environment:

apt update
apt install locales
dpkg-reconfigure locales

I then selected the locale that the error message complained about (en_US.UTF-8). Exiting and going back to the chrooted environment doesn't display the error message anymore.

luvzfootball
  • 341
  • 2
  • 5