Ntp Not Supported

Ntp Not Supported

In Ubuntu 20.04, I see that I can not change the set-ntp due to the following error.

# timedatectl set-ntp true
Failed to set ntp: NTP not supported

Any way to fix that?

UPDATE:

It seems that systemd-timesyncd fails with the start command.

$ systemctl status systemd-timesyncd
● systemd-timesyncd.service
     Loaded: masked (Reason: Unit systemd-timesyncd.service is masked.)
     Active: inactive (dead)
$ sudo systemctl start systemd-timesyncd
Failed to start systemd-timesyncd.service: Unit systemd-timesyncd.service is masked.
3

2 Answers

This worked for me on Ubuntu:

Install NTP:

apt install systemd-timesyncd

Activate NTP:

timedatectl set-ntp true
4

Your systemd-timesyncd service is masked. That means it can't be started, and can't be enabled. To reverse this, you need to run the following:

systemctl unmask systemd-timesyncd.service

Then you can enable and start the service:

systemctl enable systemd-timesyncd.service
systemctl start systemd-timesyncd.service

HOWEVER, it's pretty unlikely that your system got into this state on its own. Perhaps you followed some instructions to enable a more full-featured NTP server, like chronyd or ntpd? I recommend double-checking that they aren't installed before you proceed with the above method:

systemctl status chronyd.service
systemctl status ntp.service

If either of the above commands returns a good status, I recommend that you leave systemd-timesyncd disabled and masked.

1

Your Answer

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

James H. Sterling
Author

James H. Sterling

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.