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

转载于:https://www.cnblogs.com/outs/p/9706437.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值