Skip to content

Instantly share code, notes, and snippets.

@ascopes
Last active November 9, 2025 10:10
Show Gist options
  • Select an option

  • Save ascopes/fcf820ddbab71990516c904e5f49ccb7 to your computer and use it in GitHub Desktop.

Select an option

Save ascopes/fcf820ddbab71990516c904e5f49ccb7 to your computer and use it in GitHub Desktop.
Upgrade steps for Fedora

Upgrading Fedora

The following is summarised from https://docs.fedoraproject.org/en-US/quick-docs/upgrading-fedora-offline/

  1. Install dependencies: sudo dnf install clean-rpm-gpg-pubkey dracut-config-rescue remove-retired-packages rpmconf symlinks
    • Most of these will be used after the upgrade step next.
    • dracut-config-rescue will automate updating the rescue kernel in the future during a dnf upgrade.
  2. Update existing system
    1. sudo dnf upgrade --refresh
    2. sudo reboot
    3. sudo dnf system-upgrade download --releasever=$VERSION, where $VERSION is the new Fedora version to use.
    4. sudo dnf5 offline reboot, which schedules the upgrade during the next reboot. Cancel this with sudo dnf5 offline clean.
  3. Upgrade system config: sudo rpmconf -a
  4. Remove retired packages: sudo remove-retired-packages $OLD_VERSION where $OLD_VERSION is the previous Fedora version. If you upgraded across more than one release, then the oldest version should be provided.
  5. Remove duplicate packages: sudo dnf4 repoquery --duplicates to view the list, and sudo dnf4 remove --duplicates to remove them.
  6. Autoremove unneeded packages: sudo dnf autoremove
  7. Remove old kernels if you wish: sudo dnf remove $(sudo dnf repoquery --installonly --latest-limit=-1 -q) -- note that the lack of quotes around the subshell here is intentional, and we are querying a --latest-limit of -1, not 1, which would remove the current kernel!
  8. Remove old GPG keys: sudo clean-rpm-gpg-pubkey
  9. Remove dangling symbolic links: sudo symlinks -r /usr | grep dangling | sort to view them; sudo symlinks -r -d /usr to remove them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment