每次我嘗試執行以下操作時,我都會收到此錯誤sudo apt update
:
Hit:1 ubuntu bionic InRelease
Ign:3 linux/chrome/deb stable InRelease
Get:2 /ubuntu bionic-updates InRelease [88.7 kB]
Get:5 /linux/chrome/deb stable Release [943 B]
Get:6 http://dl.google.com/linux/chrome/deb stable Release.gpg [819 B]
Get:4 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:7 http://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]
Reading package lists... Done
E: Release file for http://dl.google.com/linux/chrome/deb/dists/stable/Release is not valid yet (invalid for another 2h 45min 28s). Updates for this repository will not be applied.
E: Release file for http://us.archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease is not valid yet (invalid for another 4h 34min 33s). Updates for this repository will not be applied.
E: Release file for http://us.archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease is not valid yet (invalid for another 1h 22min 16s). Updates for this repository will not be applied.
E: Release file for http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease is not valid yet (invalid for another 4h 32min 36s).
將不會套用此儲存庫的更新。
我已將時區重置為 UTC,但這不起作用。
我還找到了一個不同的答案,他們說我應該嘗試
sudo apt-get -o Acquire::Check-Valid-Until=false update
但這也不起作用。
我兩次都遇到同樣的錯誤。
答案1
跑步:
sudo hwclock --hctosys
此命令從 Windows 電腦的 RTC 取得最新時間並將系統時間設定為該時間。
答案2
這是時區問題。嘗試重新啟動 Docker 主機。這對我有用。
答案3
apt-get -o Acquire::Check-Valid-Until=false -o Acquire::Check-Date=false update
查看錯誤報告https://github.com/microsoft/WSL/issues/4114更多細節。
答案4
就我而言:
- 微軟Windows [版本10.0.19041.630];
- WSL 版本 2;
- Ubuntu-20.04;
該date
命令報告錯誤的日期和時間。我使用了以下內容:
sudo apt install ntp
sudo service ntp restart
然後該date
命令報告正確的數據和時間。sudo apt update
現在可以工作了。