Setting the Timezone with an automated script

Solution 1:

You should be able to do this with

cp /usr/share/zoneinfo/America/Los_Angeles /etc/localtime

Substitute the appropriate timezone in the above command.

Solution 2:

On Ubuntu 12.04 the following did the trick for me:

# http://manpages.ubuntu.com/manpages/precise/man7/debconf.7.html
export DEBCONF_NONINTERACTIVE_SEEN=true DEBIAN_FRONTEND=noninteractive
echo "Europe/Berlin" > /etc/timezone
dpkg-reconfigure tzdata

Solution 3:

Try this:

echo "Europe/London" > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata

Solution 4:

Update /etc/localtime symlink to point to correct timezone in /usr/share/zoneinfo/

ln -sf /usr/share/zoneinfo/$(tzselect) /etc/localtime