在Ubuntu20.04中,我发现由于以下错误,我无法更改set-ntp
。
# timedatectl set-ntp true
Failed to set ntp: NTP not supported
有办法解决吗?
更新:
看来systemd-timesyncd
使用start命令失败了。
$ 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.
解决方案
Using命令 sudo timedatectl set-ntp yes
<#>the问题现已得到解决。
发布于 2021-08-03 06:50:20
这在Ubuntu上对我起了作用:
安装NTP:
apt install systemd-timesyncd
启动NTP:
timedatectl set-ntp true
发布于 2021-02-20 00:31:48
您的systemd-timesyncd
服务被屏蔽了。这意味着它不能启动,也不能启用。要扭转这种状况,您需要运行以下命令:
systemctl unmask systemd-timesyncd.service
然后,您可以启用并启动服务:
systemctl enable systemd-timesyncd.service
systemctl start systemd-timesyncd.service
不管,您的系统不太可能单独进入这种状态。也许您遵循了一些指令来启用功能更全面的NTP服务器,比如chronyd
或ntpd
?我建议在您继续使用上述方法之前,重复检查它们是否已安装:
systemctl status chronyd.service
systemctl status ntp.service
如果上面的任何一个命令返回一个良好的状态,我建议您将systemd-timesyncd
禁用并蒙面。
https://askubuntu.com/questions/1314479
复制相似问题