apt update 提示 Release file for http://… is not valid yet (invalid for another d..)
由于在公司里需要使用代理上网,搞了好久,好不容易把 apt 整得可以访问外网了,结果在执行 spt update 时总是提示
Release file for http://… is not valid yet (invalid for another xxd xxh xxmin xxs)
多亏有搜索引擎,在网上找到一个类似的问题,原来是系统时间不对导致的,当前时间应该是2018年9月26日,我的Ubuntu时间还是2018年2月2日。
所以,更改一下系统时间就可以啦!
以下是 apt update 提示的具体错误信息:
dnt@dnt-OptiPlex-7010:~$ sudo apt update
Hit:2 http://security.ubuntu.com/ubuntu bionic-security InRelease
Get:1 http://cn.archive.ubuntu.com/ubuntu">http://cn.archive.ubuntu.com/ubuntu">http://cn.archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
Get:3 http://cn.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:4 http://cn.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Reading package lists... Done
E: Release file for http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease is not valid yet (invalid for another 172d 12h 57min 7s). Updates for this repository will not be applied.
E: Release file for http://cn.archive.ubuntu.com/ubuntu/dists/bionic/InReleaseis not valid yet (invalid for another 83d 11h 45min 49s). Updates for this repository will not be applied.
E: Release file for http://cn.archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease is not valid yet (invalid for another 235d 13h 24min 55s). Updates for this repository will not be applied.
E: Release file for http://cn.archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease is not valid yet (invalid for another 235d 11h 49min 56s). Updates for this repository will not be applied.
以下是更改 Ubuntu 系统时间的具体过程:
dnt@dnt-OptiPlex-7010:~$ date
2018年 02月 02日 星期五 19:53:38 CST
dnt@dnt-OptiPlex-7010:~$ timedatectl
Local time: 五 2018-02-02 19:54:45 CST
Universal time: 五 2018-02-02 11:54:45 UTC
RTC time: 五 2018-02-02 11:54:45
Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: no
systemd-timesyncd.service active: yes
RTC in local TZ: no
dnt@dnt-OptiPlex-7010:~$ date -R
Fri, 02 Feb 2018 19:56:01 +0800
dnt@dnt-OptiPlex-7010:~$ sudo date -s 09/26/18
2018年 09月 26日 星期三 00:00:00 CST
dnt@dnt-OptiPlex-7010:~$ sudo date -s 11:15:45
2018年 09月 26日 星期三 11:15:45 CST
dnt@dnt-OptiPlex-7010:~$ sudo hwclock --systohc
[sudo] password for dnt:
dnt@dnt-OptiPlex-7010:~$ date
2018年 09月 26日 星期三 11:16:00 CST