如何修複Ubuntu Linux中(zhōng)的“存儲庫無效”(Repository is not valid yet)錯誤 - 武漢新(xīn)勝電(diàn)腦
  • 武漢市武昌區(qū)南湖(hú)花(huā)園 瑞安(ān)街(jiē)140号 027-88016877
  • 18627003654
  • love6411692@qq.com

如何修複Ubuntu Linux中(zhōng)的“存儲庫無效”(Repository is not valid yet)錯誤

首頁(yè)最新(xīn)動态

如何修複Ubuntu Linux中(zhōng)的“存儲庫無效”(Repository is not valid yet)錯誤

我最近在Raspberry Pi上安(ān)裝(zhuāng)了Ubuntu服務(wù)器。我從Ubuntu終端将其連接到Wi-Fi,并在安(ān)裝(zhuāng)任何要更新(xīn)系統的Linux系統後繼續進行操作(zuò)。

當我使用(yòng)“ sudo apt update”命令時,它給了我一個錯誤,這對我來說是唯一的。它抱怨該存儲庫的發行文(wén)件在一定時間内無效。

ERROR: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和其他(tā)Linux發行版中(zhōng)修複“發布文(wén)件尚未生效”錯誤

存儲庫無效但錯誤Ubuntu

錯誤的原因是系統時間與實際時間之間的差異。

您會看到,每個存儲庫文(wén)件都在某個日期簽名(míng),您可(kě)以通過查看發布文(wén)件來查看以下信息:

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服務(wù)器上的時間過去了,這就是為(wèi)什麽Ubuntu抱怨發行文(wén)件在X天内還無效的原因。

如果您已連接到Internet,則可(kě)能(néng)需要等待幾分(fēn)鍾,系統才能(néng)同步時間

如果它不起作(zuò)用(yòng),則可(kě)以強制系統将本地時間用(yòng)作(zuò)實時時鍾(硬件時鍾):

sudo timedatectl set-local-rtc 1

使用(yòng)timedatectl命令可(kě)以在Linux上配置時間,日期和更改時區(qū)

您不需要重新(xīn)啓動。它可(kě)以立即工(gōng)作(zuò),您可(kě)以通過再次更新(xīn)Ubuntu系統來進行驗證。

如果問題得以解決,則可(kě)以将實時時鍾設置為(wèi)使用(yòng)UTC(Ubuntu建議)。

sudo timedatectl set-local-rtc 0

聯系方式 / Contact

  • 武漢新(xīn)勝電(diàn)腦
  • 地址:武漢市武昌區(qū)南湖(hú)花(huā)園 瑞安(ān)街(jiē)140号 027-88016877
  • 電(diàn)話:18627003654
  • 聯系人:彭經理(lǐ)
  • 郵箱:love6411692@qq.com
  • 網址:https://www.whxsdn.com
  •  
  •  
  •