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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM