From 07b478f8206e258ca00907ee8209b0481c453161 Mon Sep 17 00:00:00 2001 From: Rob Date: Thu, 18 Nov 2021 06:54:15 +0100 Subject: [PATCH] add upgade fedora script --- upgrade-fedora.sh | 69 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100755 upgrade-fedora.sh diff --git a/upgrade-fedora.sh b/upgrade-fedora.sh new file mode 100755 index 0000000..feff67a --- /dev/null +++ b/upgrade-fedora.sh @@ -0,0 +1,69 @@ +#/bin/bash + +echo "Step one: update everything" +echo "===========================" +echo "" + +read -n1 -s -r -p $'run now: $sudo dnf upgrade --refresh (Enter = run)' key + +if [ "$key" = "" ]; then + sudo dnf upgrade --refresh + + read -n1 -s -r -p $'and reboot your computer now! (Enter = reboot)' key + if [ "$key" = "" ]; then + reboot + fi +fi + +echo "" +echo "" +echo "Step two: install dnf-plugin-system-upgrade" +echo "===========================================" +echo "" + +read -n1 -s -r -p $'run now: $sudo dnf install dnf-plugin-system-upgrade (Enter = run)' key + +if [ "$key" = "" ]; then + sudo dnf install dnf-plugin-system-upgrade +fi + + +## get actual version in variable $VERSION_ID +source /etc/os-release +let NEXT_VERSION=$VERSION_ID+1 + +echo "" +echo "" +echo "Step three: system-upgrade download Version $NEXT_VERSION" +echo "===================================================" +echo "" + +read -n1 -s -r -p $"run now: sudo dnf system-upgrade download --releasever=$NEXT_VERSION (Enter = run)" key + +if [ "$key" = "" ]; then + sudo dnf system-upgrade download --releasever=$NEXT_VERSION +fi + +echo "" +echo "" +echo "Step four: start the upgrade" +echo "============================" +echo "" + +read -n1 -s -r -p $'run now: dnf system-upgrade reboot (Enter = run)' key + +if [ "$key" = "" ]; then + sudo dnf system-upgrade reboot +fi + +echo "" +echo "" +echo "Step five: clean the upgrade" +echo "============================" +echo "" + +read -n1 -s -r -p $'run now: dnf system-upgrade clean (Enter = run)' key + +if [ "$key" = "" ]; then + sudo dnf system-upgrade clean && dnf clean packages +fi