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?
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?
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
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
systemd-timesyncd.service
was useful - helped to see the problem with the server connectivity. – Velkan Jul 24 '18 at 09:22systemctl
part. Does your firewall allow you to access the NTP servers? – HongboZhu Jul 02 '19 at 14:18/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[Time]
is not – lewis4u Aug 23 '19 at 13:00systemd-timesynd.service
,timedatectl
still reportsSystem clock synchronized: no
. Does anyone know why this would be? – snark Sep 26 '19 at 13:28sudo apt install ntp
, then reboot. – President James K. Polk Mar 19 '20 at 14:55ntp
conflicts withsystemd-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:37sudo systemctl unmask systemd-timesyncd
– mchid Jun 26 '23 at 08:19sudo systemctl enable systemd-timesyncd
and of course, to prevent it from automatically starting while leaving you the option to manually start and call the service, you can disable it but leave it unmasked:sudo systemctl disable systemd-timesyncd
– mchid Jun 26 '23 at 08:20