Ubuntu – How to Disable timesyncd and Enable NTP

ntpUbuntu

I have installed ntp on ubuntu 16.04 but when I run timedatectl it doesn't show NTP. It shows systemd-timesyncd in the output.

I ran the command sudo systemctl disable systemd-timesyncd; sudo systemctl stop systemd-timesyncd; sudo systemctl enable ntp;

How do I set ntp for timedatectl?

I even tried timedatectl set-ntp true but still it doesn't show under timedatectl output.

root@host001:~# timedatectl
                      Local time: Fri 2020-05-08 16:00:59 UTC
                  Universal time: Fri 2020-05-08 16:00:59 UTC
                        RTC time: Fri 2020-05-08 16:00:59
                       Time zone: UTC (UTC, +0000)
       System clock synchronized: no
systemd-timesyncd.service active: no
                 RTC in local TZ: no

I was expecting output like below (as seen in others post) where NTP is shown instead of systemd-timesyncd

                      Local time: Fri 2020-05-08 16:00:59 UTC
                  Universal time: Fri 2020-05-08 16:00:59 UTC
                        RTC time: Fri 2020-05-08 16:00:59
                       Time zone: UTC (UTC, +0000)
                       Network time on: no
                       NTP synchronized: yes
                       RTC in local TZ: no

Best Answer

systemctl disable --now systemd-timesyncd
systemctl enable --now ntp

Or as Ubuntu and Red Hat are dismissing ntpd as legacy for some reason, chrony is an option

systemctl enable --now chrony

Read the timedatectl man page, (this version of) set-ntp only controls systemd-timesyncd. Being a SNTP client, it won't discipline the system clock like a proper NTP. I consider this command a little misleading, and manage the time sync service units directly.