DEV Community

Cover image for How to Upgrade to Fedora 37 In Place on Windows Subsystem for Linux (WSL)

How to Upgrade to Fedora 37 In Place on Windows Subsystem for Linux (WSL)

Jonathan Bowman on April 18, 2021

The time has once again arrived to upgrade Fedora. As detailed in another article, I installed Fedora on WSL 2. Now I want to upgrade to Fedora ver...
Collapse
 
aanno profile image
aanno

Good article. Has worked for the upgrade to F41 for me. However, it seems not to work for the upgrade to F42.

$ sudo -E dnf system-upgrade upgrade Unknown argument "upgrade" for command "system-upgrade". Add "--help" for more information about the arguments. 
Enter fullscreen mode Exit fullscreen mode

With dnf5 the upgrade changed:

Transaction stored to be performed offline. Run `dnf5 offline reboot` to reboot and run the transaction. To cancel the transaction and delete the downloaded files, use `dnf5 offline clean`. $ sudo -E dnf offline --help Usage: dnf5 [GLOBAL OPTIONS] offline <COMMAND> ... Commands: clean Remove any stored offline transaction and delete cached package files. log Show logs from past offline transactions reboot Prepare the system to perform the offline transaction and reboot to start the transactio n. status Show status of the current offline transaction _execute Internal use only, not intended to be run by the user. Execute the transaction in the of fline environment. 
Enter fullscreen mode Exit fullscreen mode

New command is:

$ sudo -E dnf offline _execute 
Enter fullscreen mode Exit fullscreen mode
Collapse
 
bowmanjd profile image
Jonathan Bowman

Thank you for noting this!

Collapse
 
matthias_morche_309bb6d41 profile image
Matthias Morche • Edited

the upgrade from 41 to 42 needs a little different commands to succeed as dnf system-upgrade upgrade is no longer available. Instead run sudo -E dnf offline _execute after the sudo -E dnf system-upgrade reboot. I successfully upgraded to fedora 42. You may also use sudo -E dnf offline reboot instead of sudo -E dnf system-upgrade reboot. However I would like to point out that Fedora 42 comes with a preconfigured WSL image that integrates with wslg out of the box and rather consider using that image than upgrading from an earlier version:
kojipkgs.fedoraproject.org/package... - Download that one, rename it to .wsl instead of .tar.xz and run it as an app. or run wsl --import Fedora C:\distro\fedora Fedora-WSL-Base-42-1.1.x86_64.tar.xz or even simpler run wsl --install FedoraLinux-42 (add --name F42 to give it another name than Fedora if You like to keep Your former installation) that downloads the Fedora image automatically and installs it.

Collapse
 
brnvrn profile image
Bruno Vernay

Hi
I suspect your variable "DNF_SYSTEM_UPGRADE_NO_REBOOT=1" is not taken into account when running sudo.
This is all I have running these:
➜ dnf system-upgrade reboot
Reboot turned off, not rebooting.

I did not have your error message. Anyway, I upgraded, thanks :-)

Could have used

  • "sudo DNF_SYSTEM_UPGRADE_NO_REBOOT=1 dnf system-upgrade reboot"
  • or "sudo -E dnf system-upgrade reboot"
Collapse
 
bowmanjd profile image
Jonathan Bowman

I have updated the article according to your good instructions. Again, many thanks!

Collapse
 
bowmanjd profile image
Jonathan Bowman

Eureka! Thank you so much.

Collapse
 
alfonso2ff profile image
alfonso2ff

Hello how are you!
I really liked the post about installing fedora on windows 10 wsl. I did the latest update of windows w on Fedora 36 as well as your guidance on the post. I noticed the amount of applications linked to linux fedora is quite large. I'm not a big fan of command line SW all the time. as is the case from linux fedora to wsl. Question: Is there a way to enter the Fedora GUI through wsl2? Thanks for everything!

Hug,

Collapse
 
bowmanjd profile image
Jonathan Bowman

Great question! This is definitely possible, but I confess I have never done it. I would suspect that it would be similar to Ubuntu setups, but I am unsure. Perhaps others here will respond.

Collapse
 
vcald profile image
Vcald • Edited

I have followed the instructions presented here to upgrade from a working fedora 40 wsl to fedora 41.
Upgrade was fine...the only issue I have now is probably not important..still, when I launch wsl fedora I get the following error message :
Failed to connect to bus: No such file or directory
Any hint on how to solve this?
I have to add that, if I run 'dnf reinstall dbus' the problem disappears temporarily...then, after a few logins it reappears again.
Thank you very much

Collapse
 
bowmanjd profile image
Jonathan Bowman

Hmmm... unsure off the top of my head. Have you had any more progress on this?

Collapse
 
darthjoker profile image
Darth Joker

Thank you @bowmanjd , this is a great article. It really helped me!
Just a fyi, this also works for 34 to 35.