I am trying to turn on Automatic Date & Time but it turns off immediately on its own.
How do I enable Automatic Date & Time?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
$ sudo apt remove ntp
And try to enable automatic Time & Date again.
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.