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

发布了65 篇原创文章 · 获赞 13 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/heroybc/article/details/101227557