如何修复Ubuntu Linux中的 “Release file is not valid yet” 错误
2023-04-18 15:52:25 时间
我最近在我的树莓派上安装了 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 update
Hit: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... Done
E: 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: Ubuntu
Label: Ubuntu
Suite: focal
Version: 20.04
Codename: focal
Date: Thu, 23 Apr 2020 17:33:17 UTC
Architectures: 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
是否为你解决了这个问题?
我希望这个提示能帮助你解决这个错误。如果你仍然遇到这个问题,请在评论栏告诉我,我会尽力帮助你。
相关文章
- 聊聊Cookie、Session、Token 背后的故事
- 袋鼠云陈吉平:深耕国产自研数字化技术与服务,持续为客户创造价值
- day03-模块化编程
- 官宣 | 袋鼠云获过亿元C+轮融资,深耕国产自研数字化技术与服务
- Doris开发手记4:倍速性能提升,向量化导入的性能调优实践
- 【案例】星环科技×某能源企业:数据中台实践
- Visual Studio Code 安装教程
- Windows版 PostgreSQL 利用 pg_upgrade 进行大版升级操作
- 一文读懂:开源大数据调度系统Taier1.2版本新增的「工作流」到底是什么?
- 一文搞懂前后端常见登录态方案
- White Rose设计与架构的想法分享
- 标签评分:海量标签如何进行系统治理?
- 教你用CSS实现表单部件
- ChunJun框架在数据还原上的探索和实践 | Hadoop Meetup精彩回顾
- MatrixOne从入门到实践10——物联网平台架构升级
- 大数据架构-Spark-configuration(官网文档)(学习随笔)
- 前端学习路线及第一天学习
- 大前端html基础学习03-定位锚点透明
- 激活数据价值,探究DataOps下的数据架构及其实践丨DTVision开发治理篇
- Linux、Windows下Redis的安装即Redis的基本使用详解