sudo timedatectl set-local-rtc 1
以下方法对于ubuntu24.04似乎无效
1. 检查当前时间服务
timedatectl status
预期输出
NTP service: active
2. 编辑配置文件
sudo vim /etc/systemd/timesyncd.conf
需修改的内容:
[Time] # 取消注释并替换为以下内容
NTP=time.windows.com
FallbackNTP=ntp.ubuntu.com
关键说明:
- 若文件为空,直接粘贴上方内容。
FallbackNTP是备用服务器,建议保留。
3. 重启时间同步服务
sudo systemctl restart systemd-timesyncd
sudo systemctl enable systemd-timesyncd
4. 验证配置是否成功
方法 1:检查当前使用的服务器
timedatectl timesync-status | grep "Server"
成功标志:
Server: time.windows.com (123.45.67.89) # IP 可能不同
方法 2:查看同步状态
timedatectl status
输出内容的关键字段:
NTP synchronized: yes
NTP service: active
2114

被折叠的 条评论
为什么被折叠?



