具体表现
执行 apt update && apt upgrade
后,出现如图报错
我的解决方案
设置 NTP Server 以自动校时
1.首先,如果您的 VPS 位于中国大陆,您需要先 设置时区
rm -rf /etc/localtime
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
2.设置 NTP Server
apt-get install -y ntpdate #安装
vim /etc/cron.daily/ntpdate #之后添加下面一行,每天进行同步。
ntpdate ntp.ubuntu.com cn.pool.ntp.org
chmod 755 /etc/cron.daily/ntpdate #修改权限
ntpdate -d cn.pool.ntp.org #立即同步时间
debian 解决方案:
apt-get install -y ntp
vim /etc/ntp.conf #修改为下面几行
server 0.debian.pool.ntp.org iburst dynamic
server 1.debian.pool.ntp.org iburst dynamic
server 2.debian.pool.ntp.org iburst dynamic
server 3.debian.pool.ntp.org iburst dynamic
/etc/init.d/ntp restart #重启