Before
$ cat /etc/redhat-release
Fedora release 42 (Adams)
$ uname -a
Linux SECHS 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun 5 18:30:46 UTC 2025 x86_64 GNU/Linux
After
$ cat /etc/redhat-release
Fedora release 43 (Forty Three)
$ uname -a
Linux SECHS 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun 5 18:30:46 UTC 2025 x86_64 GNU/Linux
STEP1. 既存で更新可能なソフトウェアをアップグレード
$ sudo dnf upgrade
Updating and loading repositories:
Repositories loaded.
Nothing to do.
$ sudo dnf upgrade --refresh
$ sudo dnf install dnf-plugin-system-upgrade
$ sudo dnf upgrade --refresh # 念のため再実行し、未更新が無いことを確認
43 を指定してsystem-upgrade
$ sudo dnf system-upgrade download --releasever=43
途中 OpenPGP について確認があるが y で進む
最後に dnf5 offilne コマンドを実行しろと来るが 無視
Transaction stored to be performed offline. Run
dnf5 offline rebootto reboot and run the transaction. To cancel the transaction and delete the downloaded files, usednf5 offline clean.
Complete!
STEP2. アップグレード 再起動
$ sudo dnf system-upgrade reboot
The system will now reboot to upgrade to release version 43.
Is this ok [y/N]:
STEP3. 更新中
WSLを再度立ち上げると
wsl: Failed to start the systemd user session for '<USER>'. See journalctl for more details.
の表示が
journalctlで確認するとまだパッケージを順次更新中であった
$ journalctl -f
Oct 31 03:12:12 SECHS dnf5[229]: [ 375/1892] Upgrading libcomps-0:0.1.23 100% | 100.9 MiB/s | 206.6 KiB | 00m00s
Oct 31 03:12:12 SECHS dnf5[229]: [ 376/1892] Installing liblastlog2-0:2. 100% | 3.5 MiB/s | 35.9 KiB | 00m00s
Oct 31 03:12:12 SECHS dnf5[229]: [ 377/1892] Upgrading util-linux-0:2.41 100% | 87.1 MiB/s | 3.6 MiB | 00m00s
Oct 31 03:12:12 SECHS dnf5[229]: [ 378/1892] Upgrading policycoreutils-0 100% | 23.2 MiB/s | 713.6 KiB | 00m00s
Oct 31 03:12:13 SECHS dnf5[229]: [ 379/1892] Upgrading selinux-policy-0: 100% | 1.6 MiB/s | 33.5 KiB | 00m00s
Oct 31 03:12:13 SECHS dnf5[229]: [ 380/1892] Upgrading selinux-policy-ta 100% | 79.3 MiB/s | 14.9 MiB | 00m00s
Oct 31 03:12:19 SECHS unknown: WSL (2 - Interop) ERROR: CreateLoginSession:2732: Timed out waiting for user session for uid=1000
Oct 31 03:12:19 SECHS systemd[1]: Starting systemd-hostnamed.service - Hostname Service...
Oct 31 03:12:19 SECHS systemd[1]: Started systemd-hostnamed.service - Hostname Service.
Oct 31 03:12:21 SECHS dnf5[229]: [ 381/1892] Upgrading container-selinux 100% | 9.5 KiB/s | 76.1 KiB | 00m08s
Oct 31 03:12:28 SECHS dnf5[229]: [ 382/1892] Upgrading passt-selinux-0:0 100% | 39.2 KiB/s | 293.7 KiB | 00m07s
Oct 31 03:12:28 SECHS dnf5[229]: [ 383/1892] Upgrading passt-0:0^2025091 100% | 53.7 MiB/s | 1.2 MiB | 00m00s
Oct 31 03:12:36 SECHS dnf5[229]: [ 384/1892] Upgrading cockpit-ws-selinu 100% | 6.1 KiB/s | 45.8 KiB | 00m07s
このまま放置
[プロセスはコード 1 (0x00000001) で終了しました]
このターミナルを Ctrl+D で閉じるか、Enter キーを押して再起動できます。
と出たら、Enterを押してWSLを再起動
STEP4. 事後確認
$ cat /etc/redhat-release
Fedora release 43 (Forty Three)
$ uname -a
Linux SECHS 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun 5 18:30:46 UTC 2025 x86_64 GNU/Linux
念のため、dnf offline statusを見たが何も残っていない為、正常にアップグレードされた模様
$ sudo dnf offline status
No offline transaction is stored.
昔は手間だったのが2,3コマンドでWSL上のFedoraをアップグレードできるようになったのは助かる
参考文献
Upgrade to Fedora 43 from Fedora 42 Workstation (GUI and CLI)