温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

怎么修复Ubuntu Linux中的 “Release file is not valid yet” 错误问题

发布时间:2021-10-22 09:48:56 来源:亿速云 阅读:131 作者:小新 栏目:系统运维

这篇文章将为大家详细讲解有关怎么修复Ubuntu Linux中的 “Release file is not valid yet” 错误问题,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。

我最近在我的树莓派上安装了 Ubuntu 服务器。我在 Ubuntu 终端连接上了 Wi-Fi,然后做了我在安装任何 Linux 系统后都会做的事情,那就是更新系统。

当我使用 sudo apt update 命令时,它给了一个对我而言特别的错误。它报出仓库的发布文件在某个时间段内无效。

E: Release file for http://ports.ubuntu.com/ubuntu-ports/dists/focal-security/InRelease is not valid yet (invalid for another 159d 15h 20min 52s). Updates for this repository will not be applied.**

下面是完整输出:

ubuntu@ubuntu:~$ sudo apt updateHit:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease    Get:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease [111 kB]                           Get:3 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease [98.3 kB]      Get:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease [107 kB]                     Reading package lists... DoneE: Release file for http://ports.ubuntu.com/ubuntu-ports/dists/focal/InRelease is not valid yet (invalid for another 21d 23h 17min 25s). Updates for this repository will not be applied.E: Release file for http://ports.ubuntu.com/ubuntu-ports/dists/focal-updates/InRelease is not valid yet (invalid for another 159d 15h 21min 2s). Updates for this repository will not be applied.E: Release file for http://ports.ubuntu.com/ubuntu-ports/dists/focal-backports/InRelease is not valid yet (invalid for another 159d 15h 21min 32s). Updates for this repository will not be applied.E: Release file for http://ports.ubuntu.com/ubuntu-ports/dists/focal-security/InRelease is not valid yet (invalid for another 159d 15h 20min 52s). Updates for this repository will not be applied.

修复 Ubuntu 和其他 Linux 发行版中 “Release file is not valid yet” 的错误。

错误的原因是系统上的时间和现实世界的时间不同。

你看,每个仓库文件都是在某个日期签名的,你可以通过查看发布文件信息了解:

sudo head /var/lib/apt/lists/ports.ubuntu.com_ubuntu_dists_focal_InRelease-----BEGIN PGP SIGNED MESSAGE-----Hash: SHA512 Origin: UbuntuLabel: UbuntuSuite: focalVersion: 20.04Codename: focalDate: Thu, 23 Apr 2020 17:33:17 UTCArchitectures: amd64 arm64 armhf i386 ppc64el riscv64 s390x

现在,由于某些原因,我的 Ubuntu 服务器上的时间是过去时间,这也是为什么 Ubuntu 报出发布文件已经无效 X 天的原因。

如果你连接到了互联网,你可以等待几分钟让系统同步时间

如果不行,你可以强制系统使用本地时间作为实时时钟(硬件时钟):

sudo timedatectl set-local-rtc 1

timedatectl 命令可以让你在 Linux 上配置时间、日期和更改时区。

你应该不需要重新启动。它可以立即工作,你可以通过更新你的 Ubuntu 系统再次验证它。

如果问题解决了,你可以将实时时钟设置为使用 UTC(Ubuntu 推荐的)。

sudo timedatectl set-local-rtc 0

关于“怎么修复Ubuntu Linux中的 “Release file is not valid yet” 错误问题”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI