1. 问题描述
在Ubuntu中使用apt update
时提示如下错误信息。
Get:1 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [109 kB]
Get:4 http://archive.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Reading package lists... Done
E: Release file for http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease is not valid yet (invalid for another 13d 21h 39min 26s). Updates for this repository will not be applied.
E: Release file for http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease is not valid yet (invalid for another 648d 4h 27min 29s). Updates for this repository will not be applied.
E: Release file for http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease is not valid yet (invalid for another 616d 0h 7min 40s). Updates for this repository will not be applied.
E: Release file for http://archive.ubuntu.com/ubuntu/dists/jammy-security/InRelease is not valid yet (invalid for another 648d 4h 26min 40s). Updates for this repository will not be applied.
2. 解决方法
经检查是系统时间同步不及时,同步系统时间就好了。
下面是最简单设置系统当前时间命令,当然也可以用其他命令。
手动设置
date -s "2024-01-16 08:47:18"
自动同步
apt install -y rdate
ntpdate -u time.nist.gov