我在 Windows 11 上通过 WSL 使用 Ubuntu 22.04。
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
正在返回:
## Installing the NodeSource Node.js 18.x repo...
## Populating apt-get cache...
+ apt-get update
Hit:1 https://apt.releases.hashicorp.com jammy InRelease
Hit:2 http://archive.ubuntu.com/ubuntu jammy InRelease
Get:3 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Hit:4 https://packages.redis.io/deb jammy InRelease
Get:5 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Get:6 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [107 kB]
Reading package lists... Done
E: Release file for http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease is not valid yet (invalid for another 5h 27min 34s). Updates for this repository will not be applied.
E: Release file for http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease is not valid yet (invalid for another 5h 27min 59s). Updates for this repository will not be applied.
E: Release file for http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease is not valid yet (invalid for another 5h 28min 40s). Updates for this repository will not be applied.
Error executing command, exiting
$ sudo head /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_jammy_InRelease
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Origin: Ubuntu
Label: Ubuntu
Suite: jammy
Version: 22.04
Codename: jammy
Date: Thu, 21 Apr 2022 17:16:08 UTC
Architectures: amd64 arm64 armhf i386 ppc64el riscv64 s390x
我是什么做的 ?
$date
Fri Feb 24 04:12:40 IST 2023
这看起来像是一个时钟或时区问题,类似于这个问题。
Google 告诉我现在是美国标准时间下午 5 点左右。鉴于您发布此消息的时间(目前是 5 小时前),您的时间应该是中午左右吧?
此时,问题可能已经自行解决(通过 WSL<->Windows 时钟同步),但如果没有,对于 WSL,请尝试:
sudo hwclock -s
如果那不起作用:
wsl --shutdown
另请参阅Stack Overflow 上的WSL2 Clock is out of sync with Windows以获取有关此问题的一些历史信息。