Skip to content

Instantly share code, notes, and snippets.

@just3ws
Last active December 15, 2015 01:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save just3ws/5184024 to your computer and use it in GitHub Desktop.
Save just3ws/5184024 to your computer and use it in GitHub Desktop.
Set the encoding to UTF-8 and the timezone to UTC on Ubuntu hosts.
#!/bin/bash -x
echo "LANG=\"en_US.UTF-8\"" >> /etc/environment
echo "LANGUAGE=\"en_US.UTF-8\"" >> /etc/environment
echo "LC_ALL=\"en_US.UTF-8\"" >> /etc/environment
source /etc/environment
apt-get install -y --reinstall locales
locale-gen en_US.UTF-8
apt-get install -y --reinstall locales
dpkg-reconfigure locales
# UTC
ln -sf /usr/share/zoneinfo/UTC /etc/localtime
ln -sf /usr/share/zoneinfo/UTC /etc/timezone
echo "TZ=\"UTC\"" >> /etc/environment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment