目次

2022.07.29 WSLのubuntuで apt update失敗

ERROR

root@ThinkPad-X1-Nano:/app/dokuwiki# apt update
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:4 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]                                                                     
Reading package lists... Done                                                                                                                 
E: Release file for http://archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease is not valid yet (invalid for another 16h 48min 29s). Updates for this repository will not be applied.
E: Release file for http://archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease is not valid yet (invalid for another 16h 49min 50s). Updates for this repository will not be applied.
E: Release file for http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease is not valid yet (invalid for another 16h 47min 23s). Updates for this repository will not be applied.

対応

確認すると、ubuntuの時間がずれてしまっている。
下記で時間合わせすれば治る。

sudo hwclock --hctosys