osedental.blogg.se

Change timezone linux ubuntu
Change timezone linux ubuntu







$ realpath -relative-to /usr/share/zoneinfo /etc/localtimeĭ'oh! /etc/localtime isn't a symlink using find, sed, md5sum This solution is optimal if you know that /etc/localtime is a symlink, which is something that both a lot of older software and guides accomplish and even modern SystemD promises and you also have GNU realpath available, which should also be available on every GNU OS distro. Using GNU realpath because /etc/localtime is a symlink IIRC, this is something those Debian devs came up with a while ago that fell out of favour. This is a simple readable file, but doesn't seem to be available on as many distros anymore. This solution is optimal on systems utilizing older versions of Systemd.

change timezone linux ubuntu

Improvement upon Raman's answer, but without the useless use of grep. If you get an error similar to timedatectl: invalid option - 'p' that means your Systemd isn't ready to rule the world. This is the preferred method for all those who believe Systemd shall rule the world. I can personally confirm that this works on ALL of my modern Linux hosts. The environment variable TZ (if set) specifies the timezone. However, some may return extra whitespace at the beginning and/or end - trim if required. All of the following solutions will give you an IANA compatible Olson timezone ID (e.g.









Change timezone linux ubuntu