Skip to content

Instantly share code, notes, and snippets.

@imabuddha
Last active January 8, 2021 08:05
Show Gist options
  • Save imabuddha/9c8cedfcf097988a3a540d33e49826f9 to your computer and use it in GitHub Desktop.
Save imabuddha/9c8cedfcf097988a3a540d33e49826f9 to your computer and use it in GitHub Desktop.
Configure linux locale for US English but metric units & Monday as first week day.

Sane linux locale

Configure linux locale for US English but metric units & Monday as first week day.

  1. edit (as root) the locale file at /etc/default/locale as shown below.
  2. Edit /etc/locale.gen as root. (example below) If it does not exist, create it.
  3. Run /usr/sbin/locale-gen as root.

You might also want to add export LC_COLLATE="C" to ~/.bashrc to make dotfiles appear first in ls.

LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
LC_TIME="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
# This file lists locales that you wish to have built. You can find a list
# of valid supported locales at /usr/share/i18n/SUPPORTED. Other
# combinations are possible, but may not be well tested. If you change
# this file, you need to rerun locale-gen.
#
# XXX GENERATED XXX
#
# NOTE!!! If you change this file by hand, and want to continue
# maintaining manually, remove the above line. Otherwise, use the command
# "dpkg-reconfigure locales" to manipulate this file. You can manually
# change this file without affecting the use of debconf, however, since it
# does read in your changes.
en_GB.UTF-8 UTF-8
en_US.UTF-8 UTF-8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment