【Linux】E: Release file for http://ports.ubuntu.comxxxxxxxxxxxxxInRelease is not valid关于时间设置的问题解决

ubuntu使用时发现
每次update都出现问题

E: Release file for http://ports.ubuntu.com/dists/bionic-backports/InRelease is not valid yet (invalid for another 14d 17h 36min 13s). Updates for this repository will not be applied.
E: Release file for http://ports.ubuntu.com/dists/bionic-proposed/InRelease is not valid yet (invalid for another 14d 17h 35min 56s). Updates for this repository will not be applied.
E: Release file for http://ports.ubuntu.com/dists/bionic-security/InRelease is not valid yet (invalid for another 14d 17h 34min 25s). Updates for this repository will not be applied.
E: Release file for http://ports.ubuntu.com/dists/bionic-updates/InRelease is not valid yet (invalid for another 14d 17h 50min 23s). Updates for this repository will not be applied.

其实是时间设置不同步导致:
需要从新设置时间

  • 输入以下
root@ubuntu:/# tzselect
  • 后选择亚洲-中国-北京(输入前面的标号后回车即可)
  • 复制文件到/etc目录下
root@ubuntu:/# cp /usr/share/zoneinfo/Asia/Shanghai  /etc/localtime
  • 再次查看时间date -R,已经修改为北京时间
  • 修改时间
sudo date -s MM/DD/YY //修改日期
sudo date -s hh:mm:ss //修改时间
  • 在修改时间以后,修改硬件CMOS的时间
  • 非常重要,如果没有这一步的话,后面时间还是不准
sudo hwclock --systohc

以上结束。

参考网址:https://blog.csdn.net/zhengchaooo/article/details/79500032

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值