14

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?

20

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
8
  • 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
  • 2
    Even after restarting systemd-timesynd.service, timedatectl still reports System clock synchronized: no. Does anyone know why this would be?
    – snark
    Sep 26 '19 at 13:28
  • 1
    @PresidentJamesMoveonPolk: At least on Ubuntu 20.04, ntp conflicts with systemd-timesyncd and wants to remove it. It must be something else. In my case, the error was a typo in the NTP configuration.
    – emk2203
    Apr 23 '20 at 12:37
0

It worked for me, when I edited /etc/systemd/timesyncd.conf, because lines below were commented. I uncommented them and changed NTP and FallbackNTP lines by my Network servers:

[Time]
NTP=172.24.3.1
FallbackNTP=172.24.44.51
RootDistanceMaxSec=5
PollIntervalMinSec=32
PollIntervalMaxSec=2048

After that, I restarted systemd-timesyncd.service, so System clock synchronized status turned to yes

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.