Login shell sets LC_CTYPE=UTF-8
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| console-setup (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned | ||
Bug Description
I'm using Ubuntu 10.04 LTS on several servers. On all of the servers the login shell sets LC_CTYPE=UTF-8. See the output below:
Ubuntu 10.04.3 LTS
Welcome to Ubuntu!
* Documentation: https:/
Last login: Fri Aug 19 04:15:31 2011 from localhost
root@gains:~# locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.utf8
LC_CTYPE=UTF-8
LC_NUMERIC=
LC_TIME=
LC_COLLATE=
LC_MONETARY=
LC_MESSAGES=
LC_PAPER=
LC_NAME=
LC_ADDRESS=
LC_TELEPHONE=
LC_MEASUREMENT=
LC_IDENTIFICATI
LC_ALL=
root@gains:~#
A LC_CTYPE=UTF-8 value generate rather annoying messages such as "Cannot set LC_CTYPE to default locale: No such file or directory".
However if I start a shell via "su -", the variable setting changes to LC_CTYPE=
root@gains:~# su -
root@gains:~# locale
LANG=en_US.utf8
LC_CTYPE=
LC_NUMERIC=
LC_TIME=
LC_COLLATE=
LC_MONETARY=
LC_MESSAGES=
LC_PAPER=
LC_NAME=
LC_ADDRESS=
LC_TELEPHONE=
LC_MEASUREMENT=
LC_IDENTIFICATI
LC_ALL=
The "su -" behavior is what I expect to be correct, since the contents of my "/etc/defaul/
root@gains:~# cat /etc/default/locale
LANG=en_US.utf8
Which from my understanding should mean that all the LC_* environment variables are set to match LANG.
Note this problem also manifests in bash tab completion for a non-privileged user, see below:
Ubuntu 10.04.3 LTS
Welcome to Ubuntu!
* Documentation: https:/
Last login: Fri Aug 19 03:28:55 2011 from localhost
warren@gains:~$ cd /-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)
-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)
bin/ dev/ home/ lib32/ lost+found/ mnt/ proc/ sbin/ srv/ tmp/ var/
boot/ etc/ lib/ lib64/ media/ opt/ root/ selinux/ sys/ usr/
warren@gains:~$ cd /^C
warren@gains:~$ su - warren
Password:
warren@gains:~$ cd /
bin/ dev/ home/ lib32/ lost+found/ mnt/ proc/ sbin/ srv/ tmp/ var/
boot/ etc/ lib/ lib64/ media/ opt/ root/ selinux/ sys/ usr/
warren@gains:~$ cd /^C
warren@gains:~$
After "su -" tab completion now works.
I imagine that the work around would be to set the desired LC_CTYPE value in /etc/default/
Regards,
Warren.
| affects: | ubuntu → console-setup (Ubuntu) |

Status changed to 'Confirmed' because the bug affects multiple users.