How to upgrade to a different release via the shell?

,

Discover has informed me that I am able to upgrade to Fedora 41 from 40:

  1. Screenshot_20241031_181000

  2. Screenshot_20241031_180939

Instead, I want to do this via my shell, since I want to log the output, and don’t want to perform such a massive update via PackageKit, since it makes scary decisions:

However, sudo dnf offline-upgrade download reports 0 available updates. In fact, even sudo dnf upgrade does!

#!/usr/bin/env -S bash
sudo dnf offline-upgrade download
[sudo] password for RokeJulianLockhart: 
Copr repo for Koi owned by birkch                                                                                                                                                                                                                                                           8.7 kB/s | 1.5 kB     00:00    
Copr repo for CoolerControl owned by codifryed                                                                                                                                                                                                                                              3.7 kB/s | 1.5 kB     00:00    
Copr repo for prismlauncher owned by g3tchoo                                                                                                                                                                                                                                                 11 kB/s | 1.5 kB     00:00    
Brave Browser                                                                                                                                                                                                                                                                                21 kB/s | 2.0 kB     00:00    
Fedora 40 - x86_64                                                                                                                                                                                                                                                                           41 kB/s |  28 kB     00:00    
Fedora 40 - x86_64 - Debug                                                                                                                                                                                                                                                                   30 kB/s |  22 kB     00:00    
Fedora 40 openh264 (From Cisco) - x86_64                                                                                                                                                                                                                                                    2.4 kB/s | 989  B     00:00    
Fedora 40 openh264 (From Cisco) - x86_64 - Debug                                                                                                                                                                                                                                            3.1 kB/s | 997  B     00:00    
Fedora 40 - x86_64 - Updates                                                                                                                                                                                                                                                                 37 kB/s |  24 kB     00:00    
Fedora 40 - x86_64 - Updates - Debug                                                                                                                                                                                                                                                         34 kB/s |  20 kB     00:00    
Fedora 40 - x86_64 - Test Updates                                                                                                                                                                                                                                                            32 kB/s |  21 kB     00:00    
Fedora 40 - x86_64 - Test Updates Debug                                                                                                                                                                                                                                                      42 kB/s |  20 kB     00:00    
google-chrome                                                                                                                                                                                                                                                                               7.2 kB/s | 1.3 kB     00:00    
google-chrome-unstable                                                                                                                                                                                                                                                                      8.1 kB/s | 1.3 kB     00:00    
RPM Fusion for Fedora 40 - Free                                                                                                                                                                                                                                                              24 kB/s | 7.8 kB     00:00    
RPM Fusion for Fedora 40 - Free tainted                                                                                                                                                                                                                                                      23 kB/s | 7.2 kB     00:00    
RPM Fusion for Fedora 40 - Free - Updates                                                                                                                                                                                                                                                    60 kB/s | 7.2 kB     00:00    
RPM Fusion for Fedora 40 - Nonfree                                                                                                                                                                                                                                                           28 kB/s | 8.1 kB     00:00    
RPM Fusion for Fedora 40 - Nonfree - Steam                                                                                                                                                                                                                                                   59 kB/s | 7.4 kB     00:00    
RPM Fusion for Fedora 40 - Nonfree - Steam Debug                                                                                                                                                                                                                                             61 kB/s | 7.7 kB     00:00    
RPM Fusion for Fedora 40 - Nonfree tainted                                                                                                                                                                                                                                                   63 kB/s | 7.7 kB     00:00    
RPM Fusion for Fedora 40 - Nonfree - Updates                                                                                                                                                                                                                                                 60 kB/s | 7.5 kB     00:00    
TeamViewer - x86_64                                                                                                                                                                                                                                                                         7.4 kB/s | 867  B     00:00    
Visual Studio Code                                                                                                                                                                                                                                                                           19 kB/s | 1.5 kB     00:00    
warpdotdev                                                                                                                                                                                                                                                                                  9.5 kB/s | 1.5 kB     00:00    
Dependencies resolved.
Nothing to do.
Complete!
The system-upgrade transaction is empty, your system is already up-to-date.

I think you need to supply --releasever=41. I’m not sure with the offline upgrade though. If you want to do it interactively and log the results, you might need to boot to multi-user mode, sign in as root on a VT, and run something like dnf upgrade --releasever=41 |& tee my-dnf.log.

1 Like

I would do that as shown at Upgrading Fedora Linux Using DNF System Plugin :: Fedora Docs though there are also other ways to do so.

3 Likes

So the undermentioned should work?

  1. #!/usr/bin/env -S bash
    sudo dnf offline-upgrade download \
       --refresh                      \
       --skip-broken                  \
       &&                             \
    sudo dnf offline-upgrade reboot
    
  2. #!/usr/bin/env -S pwsh
    sudo dnf system-upgrade download              `
       --refresh                                  `
       --skip-broken                              `
       --releasever=$([int]$(rpm -E '%fedora')+1) `
       &&                                         `
    sudo dnf system-upgrade reboot
    

It seems strange that they recommend the standard dnf upgrade, instead of the safer offline-upgrade.

Should I also add the F41 RPMfusion repository at the same time?

  1. Error: 
     Problem 1: package ffmpeg-libs-debuginfo-6.1.2-2.fc40.x86_64 from @System requires ffmpeg-debuginfo(x86-64) = 6.1.2-2.fc40, but none of the providers can be installed
      - ffmpeg-debuginfo-6.1.2-2.fc40.x86_64 from @System  does not belong to a distupgrade repository
      - problem with installed package ffmpeg-libs-debuginfo-6.1.2-2.fc40.x86_64
     Problem 2: package obs-cef-5060^cr103.0.5060.134~git20231010.17f8588-6.fc40.x86_64 from @System requires libavcodec.so.60()(64bit), but none of the providers can be installed
      - package obs-cef-5060^cr103.0.5060.134~git20231010.17f8588-6.fc40.x86_64 from @System requires libavcodec.so.60(LIBAVCODEC_60)(64bit), but none of the providers can be installed
      - package obs-cef-5060^cr103.0.5060.134~git20231010.17f8588-6.fc40.x86_64 from @System requires libavutil.so.58()(64bit), but none of the providers can be installed
      - package obs-cef-5060^cr103.0.5060.134~git20231010.17f8588-6.fc40.x86_64 from @System requires libavutil.so.58(LIBAVUTIL_58)(64bit), but none of the providers can be installed
      - package obs-cef-5060^cr103.0.5060.134~git20231010.17f8588-6.fc40.x86_64 from @System requires libavformat.so.60()(64bit), but none of the providers can be installed
      - package obs-cef-5060^cr103.0.5060.134~git20231010.17f8588-6.fc40.x86_64 from @System requires libavformat.so.60(LIBAVFORMAT_60)(64bit), but none of the providers can be installed
      - ffmpeg-libs-6.1.2-2.fc40.x86_64 from @System  does not belong to a distupgrade repository
      - problem with installed package obs-cef-5060^cr103.0.5060.134~git20231010.17f8588-6.fc40.x86_64
    
    1. #!/usr/bin/env -S bash
      sudo dnf install \
      	'https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-41.noarch.rpm' \
      	'https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-41.noarch.rpm'
      
    2. [sudo] password for RokeJulianLockhart: 
      Last metadata expiration check: 0:48:41 ago on Thu 31 Oct 2024 22:40:11 GMT.
      rpmfusion-free-release-41.noarch.rpm                                                                                                                                                                                                                                                         19 kB/s |  11 kB     00:00    
      rpmfusion-nonfree-release-41.noarch.rpm                                                                                                                                                                                                                                                      22 kB/s |  11 kB     00:00    
      Error: 
       Problem 1: conflicting requests
        - nothing provides system-release(41) needed by rpmfusion-free-release-41-1.noarch from @commandline
       Problem 2: conflicting requests
        - nothing provides system-release(41) needed by rpmfusion-nonfree-release-41-1.noarch from @commandline
      (try to add '--skip-broken' to skip uninstallable packages)
      

The repos get upgraded as part of the regular upgrade. In fact, since the repo files mostly use macros to identify the architecture and release there is seldom a change required in those files.

When I upgraded my laptop I was not required to upgrade the repo files themselves. (and never have needed to do so as a separate action)

1 Like

@computersavvy, is my problem merely that those packages haven’t had releases published which are compatible with F41, then (if you know)?

If you already have the rpmfusion-free and rpmfusion-nonfree repos enabled (check with ‘dnf repolist’) then there is no need to attempt the install as you are doing.

If fedora was already at version 41 you probably would not be getting those errors.

Did you do the recommended dnf upgrade --refresh or dnf distro-sync --refresh prior to trying the dnf system-upgrade download --releasever=41 step?

I would recommend that you remove the ‘obs-cef’ package which is not a fedora package. Also remove the ‘ffmpeg-libs-debuginfo’ . It is not necessary unless you are actively performing development and need to do debugging.
Both those packages can be reinstalled after the upgrade if they are truly necessary.

@computersavvy, yeah - dnf upgrade --refresh. I’ve never used distro-sync, because I’m unfamiliar with how it differs to the former.

That was silly of me. Thanks. Removing them works fine.

1 Like