How to enable automatic date and time on Ubuntu 19.10?

I am trying to turn on Automatic Date & Time but it turns off immediately on its own.

enter image description here This seems to happen only after installing the latest updates.

How do I enable Automatic Date & Time?


Solution 1:

Short answer:

$ sudo apt remove ntp

And try to enable automatic Time & Date again.


Long answer:

If you try to start the "systemd-timesyncd" service manually with:

systemctl start systemd-timesyncd.service

and check the status with:

systemctl status systemd-timesyncd.service

you can see that it says:

Condition: start condition failed at <some time>; 1s ago
       └─ ConditionFileIsExecutable=!/usr/sbin/ntpd was not met

So "ntpd" has to be unavailable in order for this to work. If you check the file "/lib/systemd/system/systemd-timesyncd.service.d/disable-with-time-daemon.conf" you can see some more conditions that prevent the start:

 ConditionFileIsExecutable=!/usr/sbin/ntpd
 ConditionFileIsExecutable=!/usr/sbin/openntpd
 ConditionFileIsExecutable=!/usr/sbin/chronyd
 ConditionFileIsExecutable=!/usr/sbin/VBoxService 

So depending on your installation it will also stop working if "ntp", "openntpd", "chrony" and/or VirtualBox Services are installed.