装完ubuntu后设置系统时间,发现系统时间总是与网络时间不同步
解决办法:
1.安装ntpdate工具
sudo apt-get install ntpdate
2.将系统时间与网络时间同步
sudo ntpdate cn.pool.ntp.org
# cn.pool.ntp.org是位于中国的公共ntp服务器
# 若报出no server suitable for synchronization found,等待5分钟后再试一次
3.将时间写入硬件
sudo hwclock --systohc
4.查看时间是否已同步
date