How To Set Up Time Synchronization on Ubuntu 16.04

Accurate timekeeping become a critical component of modern software deployments, Whether it is making sure that logs are well recorded in the right order or database updates are applied correctly, out of sync time can cause you many errors, data corruption, and other hard to debug issues.

With this tutorial, we are going to explain step by step how you can set up “Time Synchronization” on Ubuntu 16.04.

1. Find what is the time/date now by using the below command on “Terminal”,

sudo date

2. You can also list all the available time zones through the below command.

timedatectl list-timezones

3. Once the timezones are listed you can press “SPACE” button to page down and see the list of zones, once you find your timezone or your correct timezone, write it down on a note and press “Q” to exit the list.

4. Now let’s set the timezone that we had chosen, just make sure to write it on the below command as it was displayed on the timezones list, you may also to need to start your command with “SUDO” to perform this change, copy the command below and edit it with your timezone.

sudo timedatectl set-timezone Africa/Cairo

5. You can make sure that your changes is verified by typing the below command on ‘Terminal’.

sudo date

The timezone abbreviation will reflect to the new chosen one.

How to control “timesyncd” with “timedatectl”

Recently, most of the network time synchronization was controlled by NTP “Network Time Protocol”, This server connects to a pool of other NTP servers that provide other servers with constant and accurate time updates, let’s find how?

1. You can query the current status of “timesyncd” by running it on “Terminal”, you also don’t have to provide “sudo” before it.

2. By the below command you can enable ‘timesyncd’.

sudo timedatectl set-ntp on

3. You can the command “timedatectl” to confirm network time status.

Summary

In this tutorial we have explained how to view the system time, change time zones, work with Ubuntu’s default “timesyncd”, and install “ntpd”.

Miguel

I started this tech blog back in 2011 as a place to write down processes I took to fix my client systems and network. Now I write some tips and tricks to help others with the tech issues that one might encounter.

You may also like...