dpkg-reconfigure tzdata

选择 Asia
Ubuntu时间同步
选择 Shanghai或Chongqing
Ubuntu时间同步

date -s

按照提示进行选择时区,

然后防止系统重启后时区改变

sudo cp /usr/share/zoneinfo/Asia/ShangHai /etc/localtime

网上同步时间

  1. 安装ntpdate工具

apt-get install ntpdate

  1. 设置系统时间与网络时间同步

#cn.pool.ntp.org是位于中国的公共NTP服务器

ntpdate cn.pool.ntp.org

  1. 将系统时间写入硬件时间

hwclock –systohc

ubuntu设置系统时间与网络时间同步 :https://blog.csdn.net/qq_38157006/article/details/89952415

相关文章: