Ubuntuのapt updateのUpdates for this repository will not be appliedエラーに対処する方法
Ubuntuのapt updateのUpdates for this repository will not be appliedエラーに対処するには時刻情報を修正します。
$ sudo apt update # apt updateが失敗する [sudo] password for testuser: Hit:1 http://ppa.launchpad.net/git-core/ppa/ubuntu focal InRelease Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease Get:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB] Get:4 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB] Get:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 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 1d 4h 42min 58s). 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 1d 4h 42min 25s). 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 1d 4h 43min 47s). Updates for this repository will not be applied. $ sudo hwclock --hctosys # 例:WSLのUbuntuで時刻情報がずれた場合の修正 $ sudo apt update # apt updateが成功する Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease Hit:2 http://ppa.launchpad.net/git-core/ppa/ubuntu focal InRelease Get:3 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB] Get:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB] Get:5 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [1178 kB] Get:6 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB] Get:7 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1510 kB] Get:8 http://security.ubuntu.com/ubuntu focal-security/main Translation-en [210 kB] Get:9 http://security.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata [9132 B] Get:10 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [686 kB] Get:11 http://archive.ubuntu.com/ubuntu focal-updates/main Translation-en [296 kB] Get:12 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [14.7 kB] Get:13 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [736 kB] Get:14 http://archive.ubuntu.com/ubuntu focal-updates/restricted Translation-en [105 kB] Get:15 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [894 kB] Get:16 http://security.ubuntu.com/ubuntu focal-security/restricted Translation-en [97.9 kB] Get:17 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [677 kB] Get:18 http://security.ubuntu.com/ubuntu focal-security/universe Translation-en [115 kB] Get:19 http://security.ubuntu.com/ubuntu focal-security/universe amd64 c-n-f Metadata [13.0 kB] Get:20 http://archive.ubuntu.com/ubuntu focal-updates/universe Translation-en [196 kB] Get:21 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 c-n-f Metadata [20.0 kB] Fetched 7094 kB in 5s (1335 kB/s) Reading package lists... Done Building dependency tree Reading state information... Done 6 packages can be upgraded. Run 'apt list --upgradable' to see them.