3

I tried upgradinfg Fedora 22 to Fedora 23 using this guide However things have failed and it seems I am still on Fedora 22. However the system thinks it is running Fedora 24

  $ cat /etc/*-release
Fedora release 24 (Rawhide)
NAME=Fedora
VERSION="24 (Workstation Edition)"
ID=fedora
VERSION_ID=24
PRETTY_NAME="Fedora 24 (Workstation Edition)"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:fedoraproject:fedora:24"
HOME_URL="https://fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=Rawhide
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=Rawhide
PRIVACY_POLICY_URL=https://fedoraproject.org/wiki/Legal:PrivacyPolicy
VARIANT="Workstation Edition"
VARIANT_ID=workstation
Fedora release 24 (Rawhide)
Fedora release 24 (Rawhide)

and dnf does not work because it searches in the repos for Fedora 24.

How can I fix this.

2
  • Side note: FedUp has been deprecated (related bug), but the fedup --network 23 command can still be used because it redirects to the new dnf system-upgrade download --releasever 23 command. You should probably update the upgrade plugin first: dnf install --best dnf-plugin-system-upgrade
    – basic6
    Nov 14 '15 at 13:11
  • 1
    Could you maybe add the commands you used to your question? This guide contains a lot of unnecessary additional information all on one page and is rather confusing.
    – basic6
    Nov 20 '15 at 17:21
3

Try this:

  1. For every file /etc/*-release, set the version value to 23.
  2. Disable the fedora-rawhide repo (modify the /etc/yum.repo.d/fedora-rawhide.repo by setting enable=0)
  3. In a terminal, do dnf distro-sync
  4. If an error is thrown with package during this step and only if the package contains f24 value on the name, do a dnf remove <entier package name>.
  5. re-do dnf distro-sync

This solution should result in a valid Fedora 23 installation.

3
  • Steps 1&2 worked but I get errors with the 3rd one because dnf can't sync cache with the repositroys because repomd.xml can't be downloaded. dnf is still searching in the repos for Fedora 24. Cache for packetsource »rpmfusion-nonfree-updates« from »http://mirrors.rpmfusion.org/mirrorlist?repo=nonfree-fedora-updates-released-24&arch=x86_64« could not be synced: Cannot prepare internal mirrorlist: No URLs in mirrorlist, deactivated. [...]
    – xuma202
    Sep 29 '15 at 21:38
  • @xuma202: According to your comment, this didn't work for you, but it is the accepted answer. Did it work eventually? Have you tried dnf clean all && dnf --releasever=23 --setopt=deltarpm=false distro-sync?
    – basic6
    Nov 14 '15 at 13:20
  • And why do people try to change /etc/*-release files... Don't do that unless you have a good reason. A successful upgrade will do that for you. Oh, and if fc22 packages have been replaced with fc24 packages and he now removes those, said packages will be gone. Guys, be careful with these things!
    – basic6
    Nov 22 '15 at 12:30
1

The guide you mention is a bit convoluted and contains a lot of unnecessary additional information on one page which makes the whole subject appear very complicated when in fact 2 simple commands are sufficient in most cases. Furthermore, apparently you have to follow 2 links ("methods" in warning message that tells you not to use dnf, then "dedicated page") to get to the page that actually explains how to use the system-upgrade plugin - which is the official way to prepare the upgrade.

Specifically, this wiki page, which is linked in the question, explains how to use yum/dnf directly for upgrading, which is not recommended, it's not the official way. "Not recommended" often means "It could break something". At least, there is a yellow warning notice at the top of the page basically telling users not to do what's described on that page unless they know what they're doing. Fedora has an official way to upgrade. A long time ago, it used to be PreUpgrade, starting with Fedora 18 it was FedUp and starting with the upgrade to Fedora 23, it's now the dnf plugin "system-upgrade". To be clear, this is a plugin for dnf, not just dnf itself.

Since it's not clear which commands have been used, this will be a very generic answer.


As for the original question, an answer has already been accepted, but according to the author's comment, an error occurred. First of all, do not change version numbers in config files manually unless you have a good reason. You may break even more.

It does sound like you upgraded to rawhide instead of 23, in which case you'll want to attempt a downgrade. So may I suggest:

# dnf system-upgrade --releasever=23 --setopt=deltarpm=false distro-sync
# dnf system-upgrade reboot

Don't forget the system-upgrade argument to call the plugin!


What not to do

Don't change version numbers in config files and run dnf. If you're lucky, you've just wrongly modified a file that other programs rely on; if you're unlucky you may break future updates/upgrades, specifically when changing repo files. Don't remove the $releasever variable from the /etc/yum.repos.d/*.repo files either, these variables are important. If you do this and forget to change them again in 6 months for the next upgrade, that upgrade will probably break or fail terribly.

If you've already changed config files (following bad advice, of which you can find a lot on the Internet), revert your changes first by using the backup copy of each file you have created before changing it.


How to upgrade from Fedora 22 to Fedora 23 (officially)

Since FedUp has been deprecated and systemd is now used internally to upgrade the system, there is a new command to prepare and start the upgrade - "dnf system-upgrade ...". But for compatibility reasons, the fedup command still works.

Again, the upgrade is started by a dnf plugin called system-upgrade, not by dnf itself. So you must at least install the current version of this plugin first:

Preparation:

  1. Install/update the "system-upgrade" plugin: dnf install dnf-plugin-system-upgrade
    In some cases, it might complain about dependency issues, you may have to add --best/--allowerasing: dnf install --best dnf-plugin-system-upgrade
  2. You should update your system prior to preparing the upgrade. It often works anyway, but the upgrade is not guaranteed to work unless you update, so: dnf upgrade

Then prepare and start the upgrade, which is basically a two-step process:

  1. # dnf system-upgrade download --releasever=23
    or # fedup --network 23 (redirects to dnf system-upgrade)
  2. # dnf system-upgrade reboot

This last command will reboot the system into upgrade mode. Unlike FedUp, which created a new Grub boot entry "System Upgrade" that had to be selected on boot, the system will perform a regular shutdown, start booting normally but then start the upgrade process before the graphical desktop is loaded. If everything works out, your new Fedora 23 will boot afterwards.

dnf Python Traceback error

Currently, there are issues reported with dnf breaking, every dnf call would show a backtrace. This should be fixed by updating the system normally, but that wouldn't be possible without dnf, so a workaround has to be used. The error message (for any dnf call) would look something like this:

Traceback (most recent call last):
  File "/bin/dnf", line 36, in <module>
...
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 51: ordinal not in range(128)

A workaround would be to prepend every dnf call with LANG=C, for example to perform a full update:

# LANG=C dnf -y upgrade

dnf system-upgrade reboot loop

There are scenarios in which the system upgrade fails to start, but instead of just starting once and then rebooting back into the system, it will get itself into a reboot loop, which makes it impossible to use the system. This appears to happen so often that it's even mentioned in the README, so I thought I'd mention it here too. How to break out of the upgrade reboot loop:

  1. Right after startup, in the Grub boot menu, hit e to edit the boot parameters. In the text area, scroll down to the line that starts with linux, hit End to move the cursor to the end of the line and append (after a whitespace) rd.break. Then hit F10 to boot into emergency mode, you will get a shell.
  2. You will have to delete a file, so you have to remount the root filesystem read-write because it's mounted read-only:
    # mount -o remount,rw /sysroot
  3. Delete the system-upgrade link:
    # rm /sysroot/system-update
  4. Reboot (reboot command or Ctrl+Alt+Del), the system should boot normally. You might want to clear the upgrade files by running dnf system-upgrade clean.
-2

Ok, then this is what to do (in superuser mode):

  • rm all /etc/yum.repo.d/*.rpmnew
  • for all /etc/yum.repo.d/*.repo: replace the $releasever by 23 manually.
  • go to step 3.
2
  • I had to replace everything wiith 22 because I don't have a valid Fedora 23 but it worked.
    – xuma202
    Sep 30 '15 at 16:54
  • 1
    Downvoted, this is bad advice. The release version is a variable for a reason. Everybody expects the repo files to use these variables. They aren't changed when upgrading, because they use the variable. If you manually remove $releasever, the next upgrade will probably not work (if you're lucky).
    – basic6
    Nov 14 '15 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.