我每次尝试时都会收到此错误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).
Run Code Online (Sandbox Code Playgroud)
不会应用此存储库的更新。
我已将时区重置为 UTC,但这不起作用。
我还找到了一个不同的答案,他们说我应该尝试
sudo apt-get -o Acquire::Check-Valid-Until=false update
Run Code Online (Sandbox Code Playgroud)
但这也不起作用。
我两次都遇到了同样的错误。
小智 125
跑:
sudo hwclock --hctosys
Run Code Online (Sandbox Code Playgroud)
此命令从 Windows 机器的 RTC 获取最新时间并将系统时间设置为该时间。
小智 44
这是时区问题,请尝试重新启动 docker 主机。它对我有用
小智 24
在 ubuntu 18.04 服务器上测试:
date以验证日期时间是否正确。sudo apt update再次执行。问题都没有了。小智 15
就我而言:
该date命令报告错误的日期和时间。我使用了以下内容:
sudo apt install ntp
sudo service ntp restart
Run Code Online (Sandbox Code Playgroud)
然后date命令报告正确的数据和时间。sudo apt update现在可以工作了。
小智 13
您可以使用leon-strong提供的这个临时解决方法:
apt-get -o Acquire::Check-Valid-Until=false -o Acquire::Check-Date=false update
Run Code Online (Sandbox Code Playgroud)
有关更多详细信息,请参阅错误报告https://github.com/microsoft/WSL/issues/4114。
小智 8
我遇到了同样的问题。我通过安装 ntp 解决了这个问题
apt install ntp
Run Code Online (Sandbox Code Playgroud)
并在安装时选择您的时区。
如果您已经安装了 ntp,请使用以下命令选择正确的时区。
dpkg-reconfigure tzdata
Run Code Online (Sandbox Code Playgroud)
就我而言,问题的根源在于我在 Windows 10 和 Ubuntu 18.04 之间进行双重引导,并且每个操作系统对存储在 RTC 中的时间的解释都不同(Windows 的本地时间,Ubuntu 的 UTC)。我的解决方法是通过运行以下命令更改 Ubuntu 以将时间解释为本地时间:
timedatectl set-local-rtc 1
Run Code Online (Sandbox Code Playgroud)
我在另一个 AskUbuntu 线程中找到了这个解决方案。
小智 6
如果有人在WSL2中遇到类似问题,那么罪魁祸首可能是错误的系统日期(使用命令检查date一次)。您可以关注此github 问题以获取更新。以下命令来自同一个 github 讨论,它帮助我暂时解决了该问题。
sudo hwclock -s
Run Code Online (Sandbox Code Playgroud)
安装ntp软件包:
sudo apt install ntp
sudo echo "ip_adress" >> /etc/ntp
sed -i 's/pool /#pool /g' /etc/ntp.conf
sudo systemctl restart ntp.service
Run Code Online (Sandbox Code Playgroud)
然后:
sudo apt update
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
162893 次 |
| 最近记录: |