Enable Auto Time Sync On Ubuntu

May 13, 2018

My system clock is off by 5 minutes, so I assume auto time synchrozation is not working properly. I try to check by using timedatectl

timedatectl

I get NTP enabled: yes but NTP synchronized: no.

      Local time: Sat 2018-05-12 15:50:22 UTC
  Universal time: Sat 2018-05-12 15:50:22 UTC
        Timezone: Etc/UTC (UTC, +0000)
     NTP enabled: yes
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

I try to run sudo ntpq -p but command is not found. So I try to install ntp.

sudo apt-get install ntp

Now I get NTP synchronized: yes.

timedatectl
      Local time: Sat 2018-05-12 15:52:33 UTC
  Universal time: Sat 2018-05-12 15:52:33 UTC
        Timezone: Etc/UTC (UTC, +0000)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: n/a

The clock get updated within 5 minutes the above is done (yes, I believe the clock sync is not immediate).

I following command seems to enable immediate time sync, but I didn't really get to test it.

sudo service ntp stopsudo ntpdate -s time.nist.govsudo service ntp start

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.