adb-atomic-developer-bundle icon indicating copy to clipboard operation
adb-atomic-developer-bundle copied to clipboard

'Cannot change locale (UTF-8)' on vagrant ssh

Open navidshaikh opened this issue 9 years ago • 8 comments

vagrant ssh on OS X with VirtualBox provider throws following warning

$ vagrant ssh
bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory

navidshaikh avatar Oct 13 '15 08:10 navidshaikh

Got some reference about workaround. I could fix the issue by doing the change in the OS X terminal by unsetting ''Set locale environment variables on startup' check box as mentioned in the article. http://www.cyberciti.biz/faq/os-x-terminal-bash-warning-setlocale-lc_ctype-cannot-change-locale/

LalatenduMohanty avatar Jan 10 '16 19:01 LalatenduMohanty

We need to set UTF-8 as locale in the Vagrantbox

[vagrant@centos7-adb ~]$ locale -a | grep -i utf-8
locale: Cannot set LC_CTYPE to default locale: No such file or directory

However Macbook supports various UTF-8

$ locale -a | grep -i utf-8 | grep -i en
en_AU.UTF-8
en_CA.UTF-8
en_GB.UTF-8
en_IE.UTF-8
en_NZ.UTF-8
en_US.UTF-8

LalatenduMohanty avatar Jan 10 '16 20:01 LalatenduMohanty

Below is configuration should be look like to overcome this issue. (will soon send patch in kickstart file)

# cat /etc/locale.conf
LANG="en_US.UTF-8"
LC_ALL=en_US.utf-8

praveenkumar avatar Jan 27 '16 09:01 praveenkumar

Configuration above works for me (removes error message). Not tested with other platforms then mac though.

dkutalek avatar Feb 17 '16 15:02 dkutalek

With the latest CDK build, I can still see the warning

$ vagrant ssh
-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
[vagrant@rhel-cdk ~]$ cat /etc/os-release 
NAME="Red Hat Enterprise Linux Server"
VERSION="7.2 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="7.2"
PRETTY_NAME="Red Hat Enterprise Linux Server 7.2 (Maipo)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.2:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.2
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.2"
VARIANT="Container Development Kit (CDK)"
VARIANT_ID="cdk"
VARIANT_VERSION="2.1"
[vagrant@rhel-cdk ~]$ 

navidshaikh avatar Jun 22 '16 11:06 navidshaikh

Checked the /etc/locale.conf file in CDK box

[vagrant@rhel-cdk ~]$ cat /etc/locale.conf 
LANG="en_US.UTF-8"

navidshaikh avatar Jun 22 '16 11:06 navidshaikh

Updated the conf as mentioned by @praveenkumar in https://github.com/projectatomic/adb-atomic-developer-bundle/issues/103#issuecomment-175506501, and its fixed. We need to tweak the kickstart file

check

[vagrant@rhel-cdk ~]$ cat /etc/locale.conf 
LANG="en_US.UTF-8"
LC_ALL=en_US.utf-8
[vagrant@rhel-cdk ~]$ exit
logout
Connection to 127.0.0.1 closed.
dhcp193-133:cdk nshaikh$ vagrant ssh
Last login: Wed Jun 22 07:18:12 2016 from 10.0.2.2
[vagrant@rhel-cdk ~]$ 

navidshaikh avatar Jun 22 '16 11:06 navidshaikh

@navidshaikh yes I will take care of it, this got removed during our vagrant box size reduce exercise.

praveenkumar avatar Jun 22 '16 12:06 praveenkumar