找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 616|回复: 0

linux时间更新

[复制链接]

83

主题

12

回帖

542

积分

管理员

积分
542
发表于 2026-4-3 18:36:43 来自手机 | 显示全部楼层 |阅读模式
sudo apt update && sudo apt install ntpdate systemd-timesyncd -y

# 用阿里云国内NTP服务器,速度最快、最稳定
sudo ntpdate -u ntp.aliyun.com
# 把同步好的系统时间写入硬件时钟(RTC),减少下次开机误差
sudo hwclock -w

# 启用并启动 systemd-timesyncd 服务
sudo systemctl enable --now systemd-timesyncd
# 查看服务状态,显示 active (running) 就是正常
systemctl status systemd-timesyncd

timedatectl

一、安装并启用时间同步服务(核心步骤)

1. 安装必备工具

 

2. 手动同步一次当前时间(立刻生效)

 

3. 启用开机自动同步服务

 

4. 再次验证时间状态

 

执行后你会看到:

-  System clock synchronized: yes 

-  NTP service: active 

- 本地时间、UTC时间都正确,硬件时间也会同步到当前时间
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|LinuxCNC 中文站 ( 苏ICP备2025155256号-1 )

GMT+8, 2026-4-30 21:53 , Processed in 0.056959 second(s), 19 queries .

Powered by Linuxcnc X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表