8

I've installed the OS and the time is incorrect.

The timedatectl shows:

       System clock synchronized: no
systemd-timesyncd.service active: yes
                 RTC in local TZ: no

How to force it to sync now?

13

From man timedatectl all you need is to enable NTP-sync.

sudo timedatectl set-ntp true

then it do the rest automatically.

If it does not work check status of systemd-timesyncd.service

systemctl status systemd-timesyncd.service

and restart it

sudo systemctl restart systemd-timesyncd.service

And then check again:

$ timedatectl
...
       System clock synchronized: yes
systemd-timesyncd.service active: yes
                 RTC in local TZ: no
| improve this answer | |
  • 2
    The status of systemd-timesyncd.service was useful - helped to see the problem with the server connectivity. – Velkan Jul 24 '18 at 9:22
  • On Ubuntu 18.04 this doesn't work... can someone please verify? – lewis4u Jun 13 '19 at 11:08
  • @lewis4u: it works for me in Ubuntu18.04, the systemctl part. Does your firewall allow you to access the NTP servers? – HongboZhu Jul 2 '19 at 14:18
  • @lewis4u: are time servers configured? can you check /etc/systemd/timesyncd.conf ? You can see what time servers are used using the above systemctl status command. Indeed, on my 18.04 synchronization was off and setting set-ntp to on did not work until I set time servers. – Nik O'Lai Aug 23 '19 at 12:23
  • Inside time servers everything is commented out... only [Time] is not – lewis4u Aug 23 '19 at 13:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.