7

When I try to I get this:

# systemctl enable systemd-timesyncd.service
Failed to enable unit: Unit file systemd-timesyncd.service does not exist.

NTP is installed:

# apt-get install ntp
Reading package lists... Done
Building dependency tree       
Reading state information... Done
ntp is already the newest version (1:4.2.8p12+dfsg-3ubuntu4.20.04.1).

Also:

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

2 Answers 2

12

As @Christian Ehrhard wrote. I installed "systemd-timesyncd" and set a local NTP server as target. After restarting the service it worked just fine.

sudo apt install systemd-timesyncd
sudo nano  /etc/systemd/timesyncd.conf

set NTP=<IP_of_your_NTP_Server>

systemctl restart systemd-timesyncd

result:

System clock synchronized: yes                        
NTP service: active

further help here

Maybe look into desynchronisation problem Blog: Fix Ubuntu TimeDateCTL NTP Sync No

1

unfortunately by "installing NTP" you did effectively remove systemd-timesyncd. I can understand that it can fly by too fast on an install/upgrade to notice - but those are mutually exclusive. This is due to the fact that there can only be one NTP service reasonable working on a system.

So you could either $ apt install systemd-timesyncd which will remove NTP and make what you initially wanted work. Or alternatively if you want more sophisticated control of time sysncing then you should be aware that since 18.04 the supported and recommended package is chrony. Thereby the alternative is $ apt install chrony (which also will remove NTP).

See the bionic release notes which is when this switch happened: https://wiki.ubuntu.com/BionicBeaver/ReleaseNotes#Chrony

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .