We can use either of the two methods mentioned below to change time zone in Ubuntu 22.04 release. These are -
- use tzdata utility or,
Geographic regions across the world are divided into different time zones. We are asked to provide the time zone at the time of installation of Ubuntu.
Usually, we change time zone if we haven't provided the correct one at the time of installation for some reason. Or, we travel and it would require us to set the clock accordingly.
We would discuss each of the above mentioned command-line utilities next.
Note: Following operations would require you to have superuser privileges. In case you don't have one then, we advise you to contact your System Administrator for assistance.
Change time zone using tzdata
tzdata package contains data about time zones of the world. To check if tzdata is installed or not -
apt search tzdata
If it isn't there then, we need to install the package through standard Ubuntu repository. Therefore, update the repository and install the package -
sudo apt update sudo apt install tzdata
We advise you to update the repository before installing any package. This ensures we get to have the latest version of package available.
Thereafter, to make changes to the time zone, issue the following in terminal -
sudo dpkg-reconfigure tzdata
Now, it would ask us select the geographic area and location. For instance, your geographic location could be Europe and location --> Luxembourg. Once we are done, it would return back with the message about local time and universal time.
Change timezone using timedatectl
Apart from doing it through tzdata package. We can also change time zone through timedatectl command-line utility. To get a list of time zones, issue the following in terminal -
The list is long, therefore we need to be specific about what we are looking at. So,
timedatectl list-timezones | grep -i [region]
For instance, if we are searching for Europe -
timedatectl list-timezones | grep -i Europe
You would notice that, now list looks manageable. Copy the time zone from the list. We stick with above mentioned example for the purpose of this article - Europe/Luxembourg.
To make changes -
timedatectl set-timezone Geographic_Region/Location_Code
For instance - Europe/Luxembourg
timedatectl set-timezone Europe/Luxembourg
To verify the changes -
In conclusion, we have discussed how to change time zone in Ubuntu 22.04 release.