Skip to content

Instantly share code, notes, and snippets.

@luckylittle
Last active October 7, 2023 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save luckylittle/8ab1aa4e12aa286c60952c9449bb0986 to your computer and use it in GitHub Desktop.
Save luckylittle/8ab1aa4e12aa286c60952c9449bb0986 to your computer and use it in GitHub Desktop.
Typical workflow of Fedora system-wide upgrade to the next releasever
#!/usr/bin/env bash
sudo dnf upgrade --refresh
sudo dnf install dnf-plugin-system-upgrade
sudo dnf system-upgrade download --releasever=37
sudo dnf system-upgrade reboot
sudo dnf install remove-retired-packages
remove-retired-packages
sudo dnf repoquery --unsatisfied
sudo dnf repoquery --duplicates
sudo dnf list extras
sudo dnf remove $(sudo dnf repoquery --extras --exclude=kernel,kernel-\*)
sudo dnf autoremove
sudo bash -c '
old_kernels=($(dnf repoquery --installonly --latest-limit=-1 -q))
if [ "${#old_kernels[@]}" -eq 0 ]; then
echo "No old kernels found"
exit 0
fi
if ! dnf remove "${old_kernels[@]}"; then
echo "Failed to remove old kernels"
exit 1
fi
echo "Removed old kernels"
exit 0'
sudo dnf clean all
sudo rpm --rebuilddb
sudo dnf distro-sync
sudo dnf distro-sync --allowerasing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment