majorwiki/01-linux/distro-specific/wsl2-fedora44-inplace-upgrade.md

119 lines
4.2 KiB
Markdown

---
title: WSL2 In-Place Upgrade to Fedora 44 (with gcc14 Blocker + CUDA Repo Swap)
domain: linux
category: distro-specific
tags:
- wsl2
- fedora
- windows
- upgrade
- dnf
- cuda
- majorrig
status: published
created: 2026-06-11
updated: 2026-06-11
---
# WSL2 In-Place Upgrade to Fedora 44 (with gcc14 Blocker + CUDA Repo Swap)
In-place upgrade of the FedoraLinux-43 WSL2 instance on MajorRig to Fedora 44 using `dnf system-upgrade` + `dnf5 offline reboot`. Hit one transaction blocker (`gcc14` compat package retired in F44) and swapped the stale `cuda-fedora39` repo to `cuda-fedora44` afterward. Performed 2026-06-11.
## The Short Answer
```powershell
# PowerShell — backup first
wsl --shutdown
wsl --export FedoraLinux-43 D:\backups\fedora43.tar
```
```bash
# Inside Fedora
sudo dnf upgrade --refresh -y
sudo shutdown -h now
# relaunch, then:
sudo dnf remove gcc14-c++ gcc14 # F44 dropped gcc14 — blocks the transaction
sudo dnf system-upgrade download --releasever=44
sudo dnf5 offline reboot # applies offline upgrade, shuts distro down
# wait a few minutes, relaunch:
cat /etc/fedora-release # → Fedora release 44 (Forty Four)
```
```powershell
# PowerShell — keep WSL itself current
wsl --update
```
## Steps
1. **Back up the instance** (PowerShell). The export tar is roughly the size of the installed system — this one was 86 GB. The target directory must already exist or you get `Wsl/ERROR_PATH_NOT_FOUND`.
```powershell
wsl --shutdown
mkdir D:\backups
wsl --export FedoraLinux-43 D:\backups\fedora43.tar
```
2. **Fully update the current release, then restart the distro**
```bash
sudo dnf upgrade --refresh -y
sudo shutdown -h now
```
3. **Remove upgrade blockers.** `gcc14`/`gcc14-c++` (compat packages) were retired in Fedora 44, so the transaction fails with "does not belong to a distupgrade repository". Remove them (or use `--allowerasing` and review the summary):
```bash
sudo dnf remove gcc14-c++ gcc14
```
4. **Download and apply the upgrade**
```bash
sudo dnf system-upgrade download --releasever=44
sudo dnf5 offline reboot
```
The "reboot" applies the offline transaction and shuts the distro down — there's no real systemd reboot in WSL. Wait a couple of minutes, then relaunch. If it errors on `systemctl`, the fallback is:
```bash
export DNF_SYSTEM_UPGRADE_NO_REBOOT=1
sudo -E dnf system-upgrade reboot
```
5. **Verify and tidy up**
```bash
cat /etc/fedora-release # Fedora release 44 (Forty Four)
sudo dnf upgrade --refresh # catch post-upgrade updates
gcc --version # F44 ships gcc 16; reinstall with `dnf install gcc gcc-c++` if removed
```
```powershell
wsl --update # fixes the post-upgrade Wsl/Service/E_UNEXPECTED catastrophic failure some users hit
```
## CUDA Repo Swap
`dnf repolist` still showed `cuda-fedora39-x86_64` — NVIDIA repos are pinned per Fedora release and don't follow distro upgrades. NVIDIA publishes a fedora44 repo:
```bash
sudo rm /etc/yum.repos.d/cuda-fedora39*.repo
sudo dnf config-manager addrepo --from-repofile=https://developer.download.nvidia.com/compute/cuda/repos/fedora44/x86_64/cuda-fedora44.repo
sudo dnf upgrade --refresh
sudo dnf repolist # confirm cuda-fedora44-x86_64
```
**WSL caveat:** never install the NVIDIA *driver* inside WSL — the Windows host driver provides the GPU. Only install toolkit packages (e.g. `cuda-toolkit`).
## Gotchas & Notes
- **Don't skip more than two releases** in one jump — staged upgrades otherwise.
- **The WSL distro name is just a Windows label** — it still says "FedoraLinux-43" after the upgrade. Cosmetic fixes: Windows Terminal profile name, Start Menu shortcut, and `DistributionName`/`ShortcutPath` under `HKCU\Software\Microsoft\Windows\CurrentVersion\Lxss\{uuid}`.
- **Keep the backup tar** until the upgraded instance has proven stable for a few days, then delete to reclaim the space.
- **Restore path if needed:** `wsl --import FedoraRestore C:\WSL\FedoraRestore D:\backups\fedora43.tar` — remember imports default to root; fix via `/etc/wsl.conf` `[user] default=majorlinux`.
## See Also
- [WSL2 Instance Migration (Fedora 43)](wsl2-instance-migration-fedora43.md)
- [WSL2 Backup via PowerShell](wsl2-backup-powershell.md)