├── .tito ├── packages │ ├── fedora-upgrade │ └── .readme ├── tito.props └── releasers.conf ├── rpm-print-name-from-filename.py ├── fedora-remove-old-gpg-keys.8.asciidoc ├── fedora-remove-old-gpg-keys ├── remove-retired-packages.8.asciidoc ├── fedora-upgrade.8.asciidoc ├── remove-retired-packages ├── README.md ├── fedora-upgrade.spec ├── fedora-upgrade └── LICENSE /.tito/packages/fedora-upgrade: -------------------------------------------------------------------------------- 1 | 42.3-1 ./ 2 | -------------------------------------------------------------------------------- /.tito/tito.props: -------------------------------------------------------------------------------- 1 | [buildconfig] 2 | builder = tito.builder.Builder 3 | tagger = tito.tagger.VersionTagger 4 | changelog_do_not_remove_cherrypick = 0 5 | changelog_format = %s 6 | -------------------------------------------------------------------------------- /.tito/packages/.readme: -------------------------------------------------------------------------------- 1 | the rel-eng/packages directory contains metadata files 2 | named after their packages. Each file has the latest tagged 3 | version and the project's relative directory. 4 | -------------------------------------------------------------------------------- /.tito/releasers.conf: -------------------------------------------------------------------------------- 1 | [fedora-git] 2 | releaser = tito.release.FedoraGitReleaser 3 | branches = fedora-all 4 | 5 | [fedora-rawhide] 6 | releaser = tito.release.FedoraGitReleaser 7 | branches = rawhide 8 | -------------------------------------------------------------------------------- /rpm-print-name-from-filename.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | import dnf 3 | import sys 4 | 5 | subject = dnf.subject.Subject(sys.argv[1]) 6 | possible_nevra = subject.get_nevra_possibilities() 7 | print(possible_nevra[0].name) 8 | 9 | -------------------------------------------------------------------------------- /fedora-remove-old-gpg-keys.8.asciidoc: -------------------------------------------------------------------------------- 1 | fedora-remove-old-gpg-keys(8) 2 | ============================= 3 | :man source: fedora-remove-old-gpg-keys 4 | :man manual: Fedora Upgrade 5 | 6 | NAME 7 | ---- 8 | fedora-remove-old-gpg-keys - tool to remove old RPM GPG keys 9 | 10 | 11 | SYNOPSIS 12 | -------- 13 | *fedora-remove-old-gpg-keys* 14 | 15 | 16 | DESCRIPTION 17 | ----------- 18 | 19 | Script *fedora-remove-old-gpg-keys* removes from rpmdb the GPG keys of EOLed Fedora Linuxes. 20 | 21 | 22 | SEE ALSO 23 | -------- 24 | rpm(8), fedora-upgrade(8) 25 | 26 | 27 | BUGS 28 | ---- 29 | If you experience some problem, please report it at: https://github.com/xsuchy/fedora-upgrade/issues 30 | 31 | 32 | AUTHOR 33 | ------ 34 | Miroslav Suchý 35 | -------------------------------------------------------------------------------- /fedora-remove-old-gpg-keys: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | # get full list of all GPG keys: 4 | # rpm -qa --qf '%{name}-%{version}-%{release} %{summary}\n' gpg-pubkey 5 | # rpm -qa --qf '%{name}-%{version}-%{release} %{summary}\n' gpg-pubkey |grep '(32)' |awk '{ print $1 }' |sort |uniq 6 | 7 | # Fedora 30 8 | rpm -e gpg-pubkey-c0aeda6e-5ad45327 2>/dev/null 9 | rpm -e gpg-pubkey-1d14a795-5ad4532e 2>/dev/null 10 | rpm -e gpg-pubkey-cfc659b9-5b6eac67 2>/dev/null 11 | 12 | # Fedora 31 13 | rpm -e gpg-pubkey-c481937a-5bc4662d 2>/dev/null 14 | rpm -e gpg-pubkey-3c3359c4-5c6ae44d 2>/dev/null 15 | rpm -e gpg-pubkey-54a86092-5bc4663b 2>/dev/null 16 | 17 | # Fedora 32 18 | for i in gpg-pubkey-100bcd92-5ca9b382 gpg-pubkey-12c944d0-5d5156ab gpg-pubkey-6dc1be18-5ca9b41f; do 19 | rpm -e "$i" 2>/dev/null 20 | done 21 | 22 | # Fedora 33 23 | rpm -e gpg-pubkey-9570ff31-5e3006fb 2>/dev/null 24 | 25 | # Fedora 37 26 | rpm -e gpg-pubkey-5323552a-6112bcdc 2>/dev/null 27 | 28 | # Fedora 38 29 | rpm -e gpg-pubkey-eb10b464-6202d9c6 2>/dev/null 30 | 31 | # Fedora 39 32 | rpm -e gpg-pubkey-18b8e74c-62f2920f 2>/dev/null 33 | 34 | true 35 | -------------------------------------------------------------------------------- /remove-retired-packages.8.asciidoc: -------------------------------------------------------------------------------- 1 | remove-retired-packages(8) 2 | ========================== 3 | :man source: remove-retired-packages 4 | :man manual: Remove Retired Packages 5 | 6 | NAME 7 | ---- 8 | remove-retired-packages - tool to remove packages no longer shipped by Fedora's distribution. 9 | 10 | 11 | SYNOPSIS 12 | -------- 13 | *remove-retired-packages* [VERSION] 14 | 15 | 16 | DESCRIPTION 17 | ----------- 18 | 19 | Script *remove-retired-packages* checks which packages has been retired (removed) between current version of Fedora Linux and VERSION's version. When no paramters is passed then VERSION is set to current version minus one. 20 | 21 | SEE ALSO 22 | -------- 23 | dnf(8), fedora-upgrade(8), 24 | https://docs.fedoraproject.org/en-US/package-maintainers/Package_Retirement_Process/ 25 | 26 | 27 | BUGS 28 | ---- 29 | If you experience some problem, please report it at: https://github.com/xsuchy/fedora-upgrade/issues 30 | 31 | `remove-retired-packages` is built on top of DNF. If you want to later investigate what you actually done, you can check `dnf history`. 32 | 33 | AUTHOR 34 | ------ 35 | Miroslav Suchý 36 | -------------------------------------------------------------------------------- /fedora-upgrade.8.asciidoc: -------------------------------------------------------------------------------- 1 | fedora-upgrade(8) 2 | ================= 3 | :man source: fedora-upgrade 4 | :man manual: Fedora Upgrade 5 | 6 | NAME 7 | ---- 8 | fedora-upgrade - tool to guide you with upgrade of Fedora to next major version using dnf. 9 | 10 | 11 | SYNOPSIS 12 | -------- 13 | *fedora-upgrade* [--help] [--tmpfs=SIZE] [--upgrade-to=VERSION] 14 | 15 | 16 | DESCRIPTION 17 | ----------- 18 | 19 | Script *fedora-upgrade* tries to automate steps needed for dnf-upgrade from one major version to next one. 20 | 21 | Steps which fedora-upgrade does: 22 | 23 | * Display usual warnings. 24 | * Check dependencies. 25 | * Resolve old .rpmsave and .rpmnew files before upgrading (if there are some). 26 | * Download and import RPM GPG keys. 27 | * Run "dnf --releasever=$TOVER distro-sync". 28 | * Install missing packages from group 'Minimal Install'. 29 | * Resolve old .rpmsave and .rpmnew files after upgrade. 30 | * Reset priorities of services. 31 | 32 | --tmpfs=SIZE - When performing online upgrade and you have small /var/cache/dnf then this option will mount /var/cache/dnf as tmpfs with specified size. The SIZE can be anything what accepts `mount` command. E.g. "3G". The mount point is unmounted when dnf finishes. 33 | 34 | -u=VERSION, --upgrade-to=VERSION - By default `fedora-upgrade` upgrade to next version. I.e. from 29 to 30. You can specify to which version you are going to upgrade and upgrade from 28 to 30. Be warned that this is hardly tested and there can be some issues. The VERSION is a number or string "rawhide". 35 | 36 | SEE ALSO 37 | -------- 38 | dnf(8), rpmconf(8), fedora-remove-old-gpg-keys(8) 39 | https://fedoraproject.org/wiki/Upgrading_Fedora_using_package_manager 40 | 41 | 42 | BUGS 43 | ---- 44 | If you experience some problem, please report it at: https://github.com/xsuchy/fedora-upgrade/issues 45 | 46 | 47 | AUTHOR 48 | ------ 49 | Miroslav Suchý 50 | -------------------------------------------------------------------------------- /remove-retired-packages: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | set -e 3 | 4 | # speed up sort and comm 5 | export LC_ALL=C 6 | 7 | source /etc/os-release 8 | if [[ ! "$1" =~ ^[0-9]*$ ]] 9 | then 10 | echo "usage: $(basename "$0") [fedora linux version number as digits]." 11 | exit 1 12 | fi 13 | UPGRADE_FROM="$1" 14 | if [ -z "$UPGRADE_FROM" ]; then 15 | UPGRADE_FROM=$(("$VERSION_ID"-1)) 16 | fi 17 | UPGRADE_TO="$VERSION_ID" 18 | echo "Looking for retired packages between Fedora Linux $UPGRADE_FROM and Fedora Linux $UPGRADE_TO" 19 | echo "Retired packages are no longer maintained. Answer N to the following questions to keep them," 20 | echo "but these packages will not get any updates. Not even security updates." 21 | 22 | TDIR=$(mktemp --directory --tmpdir remove-retired.XXXXXXXXX) 23 | TO_REMOVE="$TDIR/retired" 24 | OLD_LIST="$TDIR/old" 25 | NEW_LIST="$TDIR/new" 26 | INST_LIST="$TDIR/installed" 27 | RM_LIST="$TDIR/toberemoved" 28 | 29 | function pause() { 30 | # clear the stdin buffer and pause with question 31 | read -t 1 -n 10000 discard || [ $? -gt 128 ] 32 | read -p "Hit Enter to continue with other package or Ctrl + C to interrupt." 33 | } 34 | 35 | 36 | #--repo={fedora,fedora-modular,updates,updates-modular}-source 37 | 38 | 39 | echo "Gathering package list for Fedora Linux $UPGRADE_FROM" 40 | # in case the metadata are signed and GPG key is not yet imported 41 | dnf repoquery -q --releasever "$UPGRADE_FROM" --disableplugin=local XXXXXXXXXXXX 42 | # sed from the repoquery can be remove when dnf4 will be a history 43 | dnf repoquery -q --releasever "$UPGRADE_FROM" --disableplugin=local --qf="%{name}\n" | sort | sed -r '/^\s*$/d' > "$OLD_LIST" 44 | #repoquery --releasever "$UPGRADE_FROM" --arch src -a | pkgname | sort | uniq > "$OLD_LIST" 45 | echo "Gathering package list for Fedora Linux $UPGRADE_TO" 46 | # in case the metadata are signed and GPG key is not yet imported 47 | dnf repoquery -q --releasever "$UPGRADE_TO" --disableplugin=local XXXXXXXXXXXX 48 | dnf repoquery -q --releasever "$UPGRADE_TO" --disableplugin=local --qf="%{name}\n" | sort | sed -r '/^\s*$/d' > "$NEW_LIST" 49 | comm -23 "$OLD_LIST" "$NEW_LIST" > "$TO_REMOVE" 50 | 51 | echo "Asking for super user access:" 52 | sudo true Executed from remove-retired-packages 53 | 54 | echo "These packages have been retired:" 55 | rpm -qa --qf '%{name}\n' | sort > "$INST_LIST" 56 | comm -12 "$TO_REMOVE" "$INST_LIST" > "$RM_LIST" 57 | while read PACKAGE; do 58 | SUMMARY=$(rpm -q --qf "%{summary}" "$PACKAGE" | head -n1 ) 59 | echo "$PACKAGE: $SUMMARY" 60 | done < "$RM_LIST" 61 | 62 | while read -u 7 PACKAGE; do 63 | #skip if this package is not installed 64 | rpm -q "$PACKAGE" 2>/dev/null >&2 || continue 65 | 66 | SUMMARY=$(rpm -q --qf "%{summary}" "$PACKAGE" | head -n1 ) 67 | echo "Removing $PACKAGE: $SUMMARY" 68 | SRPMFILENAME=$(rpm -q --qf "%{sourcerpm}" "$PACKAGE") 69 | SRPM=$(rpm-print-name-from-filename "$SRPMFILENAME") 70 | REASON=$(curl --fail https://src.fedoraproject.org/rpms/$SRPM/raw/rawhide/f/dead.package 2>/dev/null || echo "unknown reason") 71 | if [ "$REASON" = "unknown reason" ]; then 72 | if curl --fail https://src.fedoraproject.org/rpms/$SRPM/raw/rawhide/f/${SRPM}.spec 2>/dev/null >/dev/null; then 73 | REASON="$PACKAGE was subpackage of $SRPM, but this subpackages was removed" 74 | fi 75 | fi 76 | echo "Reason of retirement: $REASON" 77 | sudo dnf remove "$PACKAGE" || pause 78 | done 7< "$RM_LIST" 79 | 80 | # cleanup 81 | rm -rf "$TDIR" 82 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | fedora-upgrade 2 | ============== 3 | 4 | Upgrade Fedora to next version using dnf upgrade. 5 | 6 | This is an attempt to automatize steps as listed here: 7 | 8 | https://fedoraproject.org/wiki/Upgrading_Fedora_using_package_manager 9 | 10 | 11 | What works 12 | ========== 13 | 14 | Please note that fedora-upgrade is NOT officially supported upgrade path. 15 | That means it is not tested by Fedora QA before release and bugs in fedora-upgrade 16 | are not a blocker for release. 17 | 18 | You can upgrade to any version. However, Fedora QA tests, and most users upgrade to next version.next version. 19 | 20 | How it works 21 | ============ 22 | 23 | 1. Display link to release notes and ask you if you really want to upgrade. 24 | 2. Check if dependencies are installed and install them. This step is only needed if you download the script from GitHub. Dependencies are always present if you install fedora-upgrade as rpm package. 25 | 3. Resolve old .rpmsave and .rpmnew files using [rpmconf](https://github.com/xsuchy/rpmconf/). This step is optional and can be skipped. But it is better to start to upgrade with a clean state. 26 | 4. Download and install new GPG keys - including rpmfusion if you are using it. 27 | 5. Update dnf and clean all dnf metadata. 28 | 6. Upgrade system using dnf. In this or any previous step, you can hit Ctrl + C and interrupt upgrade and repeat it as many times you wish. After this step, you could not return (you can use back up, you created a backup before upgrade, did you?). You can choose between offline upgrade: 29 | * offline - this use dnf-plugin-system-upgrade plugin and requires two reboots - this is official upgrade method 30 | * online - this use distro-sync and require only one reboot - this is not officially tested by FedoraQA 31 | 7. Install packages from group 'Minimal Install'. It may happen that some new essential packages have been introduced to Fedora. This step will install them. You may, however, skip this step if you want to. 32 | 8. Clean old caches (YUM, DNF, PackageKit). 33 | 9. Resolve old .rpmsave and .rpmnew files using [rpmconf](https://github.com/xsuchy/rpmconf/). This step is optional and can be skipped. But it is better to finish the upgrade with a clean state. 34 | 10. Reset service priorities - the order of init scripts could have changed from the previous version. This step is optional and can be skipped. And this does not affect services already migrated to systemD units. 35 | 11. Optionally report orphaned packages (packages that are not present in Fedora anymore) and you have them installed from the previous version. 36 | 12. Report success and suggest you reboot. 37 | 38 | If there will be a problem during upgrade, this script will immediately stop and will not continue. 39 | If you hit a problem before step 6, you can run fedora-upgrade again after you resolve the problem. 40 | If you hit a problem in the later stage, you can resolve the issue manually and open fedora-upgrade as it is just bash script. And try to finish manually. But most steps after step 6 are optional, so it should not affect the stability of your system. 41 | 42 | Example 43 | ======= 44 | 45 | # fedora-upgrade 46 | Going to upgrade your Fedora to version 24. 47 | You may want to read Release Notes: 48 | http://docs.fedoraproject.org/release-notes/ 49 | Hit Enter to continue or Ctrl + C to cancel. 50 | 51 | Going to run 'dnf upgrade' before upgrading. 52 | This step is highly recommended but can be safely skipped. 53 | Hit Enter to continue, Ctrl + C to cancel or S + Enter to skip. 54 | Last metadata expiration check: 2:35:57 ago on Mon Apr 25 16:05:04 2016. 55 | Závislosti vyřešeny. 56 | Není co dělat 57 | Hotovo! 58 | 59 | Going to resolve old .rpmsave and .rpmnew files before upgrading. 60 | This step is highly recommended but can be safely skipped. 61 | Hit Enter to continue, Ctrl + C to cancel or S + Enter to skip. 62 | Configuration file '/etc/mime.types' 63 | -rw-r--r--. 1 root root 57068 25. Sep 2015 /etc/mime.types.rpmnew 64 | -rw-r--r--. 1 root root 57618 9. Nov 09.45 /etc/mime.types 65 | 66 | ==> Package distributor has shipped an updated version. 67 | What would you like to do about it ? Your options are: 68 | Y or I : install the package maintainer's version 69 | N or O : keep your currently-installed version 70 | D : show the differences between the versions 71 | M : merge configuration files 72 | Z : background this process to examine the situation 73 | S : skip this file 74 | The default action is to keep your current version. 75 | *** aliases (Y/I/N/O/D/M/Z/S) [default=N] ? 76 | Your choice: i 77 | Choose upgrade method 78 | * offline - this use dnf-plugin-system-upgrade plugin and requires two reboots 79 | - this is official upgrade method 80 | * online - this use distro-sync and require only one reboot 81 | - this is not officially tested by FedoraQA 82 | For more information see https://fedoraproject.org/wiki/Upgrading 83 | 84 | What is your choice? (offline/online) offline 85 | 86 | ********** End of DNF plugin output ********** 87 | 88 | Download complete! The downloaded packages were saved in cache till the next 89 | successful transaction. You can remove cached packages by executing 90 | 'dnf clean packages'. 91 | In next step, your computer will be REBOOTED, and packages will be upgraded. 92 | Hit Enter to continue, Ctrl + C to cancel or S + Enter to skip. 93 | 94 | 95 | Note 96 | ==== 97 | 98 | If you are upgrading to branched development version then updates-testing is automatically enabled. 99 | 100 | BUGS 101 | ==== 102 | 103 | See https://apps.fedoraproject.org/packages/fedora-upgrade/bugs 104 | 105 | If you find bug, please [report](https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&version=rawhide&component=fedora-upgrade) it. 106 | 107 | 108 | License 109 | ======= 110 | 111 | GPLv2 112 | -------------------------------------------------------------------------------- /fedora-upgrade.spec: -------------------------------------------------------------------------------- 1 | Name: fedora-upgrade 2 | Version: 42.3 3 | Release: 1%{?dist} 4 | Summary: Upgrade Fedora to next version using dnf upgrade (unofficial tool) 5 | 6 | License: GPL-2.0-only 7 | URL: https://github.com/xsuchy/fedora-upgrade 8 | # Sources can be obtained by 9 | # git clone git://github.com/xsuchy/fedora-upgrade.git 10 | # cd fedora-upgrade 11 | # tito build --tgz 12 | Source0: %{name}-%{version}.tar.gz 13 | BuildArch: noarch 14 | 15 | %if 0%{?fedora} >= 41 16 | Requires: dnf5 17 | %else 18 | Requires: dnf 19 | Requires: dnf-plugins-core 20 | Recommends: dnf-plugin-system-upgrade 21 | Requires: dnf-utils 22 | %endif 23 | Requires: sudo 24 | Requires: cpio 25 | Requires: rpmconf 26 | Requires: libselinux-utils 27 | Requires: policycoreutils 28 | Requires: distribution-gpg-keys >= 1.51 29 | Suggests: vim-enhanced 30 | Requires: wget 31 | Requires: remove-retired-packages 32 | BuildRequires: asciidoc 33 | BuildRequires: libxslt 34 | 35 | %description 36 | Upgrade Fedora to next version using dnf upgrade. 37 | This is attempt to automatize steps as listed here: 38 | https://fedoraproject.org/wiki/Upgrading_Fedora_using_package_manager 39 | 40 | This is an unofficial tool, for official Fedora-supported 41 | upgrades please see: 42 | https://fedoraproject.org/wiki/Upgrading 43 | 44 | %package -n remove-retired-packages 45 | Summary: Remove retired distribution's packages 46 | Requires: curl 47 | Requires: python3-dnf 48 | 49 | %description -n remove-retired-packages 50 | Script that removes packages removed from 51 | Fedora distribution. 52 | 53 | %prep 54 | %setup -q 55 | 56 | %build 57 | for i in fedora-remove-old-gpg-keys.8.asciidoc fedora-upgrade.8.asciidoc remove-retired-packages.8.asciidoc; do 58 | a2x -d manpage -f manpage "$i" 59 | done 60 | 61 | %install 62 | mkdir -p %{buildroot}%{_sbindir} 63 | mkdir -p %{buildroot}%{_bindir} 64 | mkdir -p %{buildroot}%{_mandir}/man8 65 | mkdir -p %{buildroot}%{_datadir}/%{name} 66 | install -m755 fedora-upgrade %{buildroot}%{_sbindir} 67 | install -m644 fedora-upgrade.8 %{buildroot}/%{_mandir}/man8/ 68 | install -m755 remove-retired-packages %{buildroot}%{_sbindir} 69 | install -m644 remove-retired-packages.8 %{buildroot}/%{_mandir}/man8/ 70 | install -m755 fedora-remove-old-gpg-keys %{buildroot}%{_sbindir}/ 71 | install -m644 fedora-remove-old-gpg-keys.8 %{buildroot}/%{_mandir}/man8/ 72 | install -m755 rpm-print-name-from-filename.py %{buildroot}%{_bindir}/rpm-print-name-from-filename 73 | 74 | %files 75 | %license LICENSE 76 | %doc README.md 77 | %{_sbindir}/fedora-upgrade 78 | %doc %{_mandir}/man8/fedora-upgrade.8* 79 | %{_datadir}/%{name} 80 | 81 | %files -n remove-retired-packages 82 | %{_sbindir}/remove-retired-packages 83 | %{_sbindir}/fedora-remove-old-gpg-keys 84 | %{_bindir}/rpm-print-name-from-filename 85 | %doc %{_mandir}/man8/remove-retired-packages.8* 86 | %doc %{_mandir}/man8/fedora-remove-old-gpg-keys.8* 87 | %license LICENSE 88 | 89 | %changelog 90 | * Mon Aug 18 2025 Miroslav Suchý 42.3-1 91 | - add upgrade to Fedora 43 92 | - remove upgrade to F40 that is EOL 93 | - typo 94 | - dnf5 uses /var/cache/libdnf5 95 | 96 | * Mon Jun 09 2025 Miroslav Suchý 42.2-1 97 | - do not check if F42 is prerelease 98 | 99 | * Wed Mar 19 2025 Miroslav Suchý 42.1-1 100 | - enable updates testing for 42 as it is pre-release now 101 | - Support upgrading to fedora 42 102 | 103 | * Thu Dec 26 2024 Miroslav Suchý 41.3-1 104 | - correctly detect tmux 105 | - requires sudo 106 | - add reverence to `dnf history` in man page 107 | - add old gpg keys 108 | - group minimal install does not exist anymore 109 | - move rawhide version 110 | 111 | * Tue Nov 05 2024 Miroslav Suchý 41.2-1 112 | - remove-retired-packages: detect removed subpackages 113 | - no need to check if F41 is prerelease 114 | - add new line to repoquery to make remove-retired-packages work with dnf5 115 | 116 | * Sat Aug 17 2024 Miroslav Suchý 41.1-1 117 | - add upgrade to f41 118 | 119 | * Sun Mar 24 2024 Miroslav Suchý 40.1-1 120 | - upgrade to F40 121 | 122 | * Sun Mar 24 2024 Miroslav Suchý 39.2-1 123 | - add upgrade to F40 124 | 125 | * Wed Aug 23 2023 Miroslav Suchý 39.1-1 126 | - remove upgrade to F37 127 | - add upgrade to f39 and remove upgrade to f36 128 | - add f39 to releasers 129 | - Speed up selecting retired installed packages 130 | - Require DNF 5 in Fedora >= 41, not Fedora > 38 131 | 132 | * Sun May 28 2023 Miroslav Suchý 38.2-1 133 | - use dnf5 on F39+ 134 | - Fix typo in main script 135 | 136 | * Thu Mar 16 2023 Miroslav Suchý 38.1-1 137 | - add upgrades to F38 138 | - Use "Fedora Linux" to refer to the distro 139 | 140 | * Wed Nov 30 2022 Miroslav Suchý 37.2-1 141 | - do not check if f37 is prerelease 142 | - use spdx license 143 | - 2142229 - reference for log what executed /usr/bin/true 144 | - report reason of the retirement 145 | 146 | * Thu Aug 25 2022 Miroslav Suchý 37.1-1 147 | - bump up version 148 | 149 | * Thu Aug 25 2022 Miroslav Suchý 36.4-1 150 | - add f37 to releasers 151 | - remove upgrade to f35 152 | - remove upgrade to f34 153 | - check if f37 is prerelease 154 | - UPGRADE_FINISHED=2 is for in-progress-to-rawhide 155 | - Add update to F37 156 | - Set current rawhide version 157 | - Do not ignore user request to skip 158 | - Update remove-retired-packages 159 | - do not stop when you want to skip one package 160 | - fixed one typo 161 | 162 | * Sun May 08 2022 Miroslav Suchý 36.3-1 163 | - do not test prerelease for F36 164 | - remove-retired-packages: Normalize grammatical tense in messages 165 | - remove-retired-packages: Rewrite introductory text for better clarity 166 | - remove-retired-packages: Normalize quotation marks in echo commands 167 | - ignore if rpmfusion repos are not present during upgrade to rawhide 168 | - ignore if some gpg keys to be remove are missing 169 | - 2066053 - ask for the GPG key if needed 170 | - remove-retired-packages: Typo 171 | 172 | * Fri Mar 18 2022 Miroslav Suchý 36.2-1 173 | - 2065720 - fix path to fedora-remove-old-gpg-keys 174 | 175 | * Wed Feb 09 2022 Miroslav Suchý 36.1-1 176 | - add upgrade to Feodora 36 177 | - failure during reset of services preset should not be fatal 178 | 179 | * Tue Nov 09 2021 Miroslav Suchý 35.3-1 180 | - do not test prerelease during upgrade to F35 181 | - note fedora-remove-old-gpg-keys in fedora-upgrade man page 182 | - print whole list before asking on individual packages 183 | - add fedora 33 gpg keys to remove 184 | - add fedora 32 gpg keys to remove 185 | - add fedora-remove-old-gpg-key 186 | - fail if something fail, or when user interrupt 187 | - grammar edits 188 | - work on list of removed packages rather than components 189 | - Small changes to reduce dependencies 190 | 191 | * Thu Sep 23 2021 Miroslav Suchý 35.2-1 192 | - add remove-retired-packages 193 | 194 | * Thu Sep 16 2021 Miroslav Suchý 35.1-1 195 | - remove upgrade to f32 196 | - add upgrade to f35 197 | 198 | * Thu Apr 29 2021 Miroslav Suchý 34.3-1 199 | - remove prerelease test for F34 200 | 201 | * Tue Feb 23 2021 Miroslav Suchý 34.2-1 202 | - fedora-repos-modular does not need to be installed 203 | - handle special case of rdma-core.i686 204 | - print info when checking updates 205 | 206 | * Thu Feb 11 2021 Miroslav Suchý 34.1-1 207 | - remove f31 208 | - add f34 209 | - rawhide is f35 210 | 211 | * Wed Nov 04 2020 Miroslav Suchý 33.2-1 212 | - do not test if F33 is prerelease 213 | 214 | * Tue Aug 25 2020 Miroslav Suchý 33.1-1 215 | - bump up version 216 | 217 | * Tue Aug 25 2020 Miroslav Suchý 32.3-1 218 | - do not check prerelease when upgrading to F32 219 | - add Fedora 33 220 | 221 | * Wed Mar 04 2020 Miroslav Suchý 32.2-1 222 | - 1767351 - reset modules before the upgrade 223 | 224 | * Tue Mar 03 2020 Miroslav Suchý 32.1-1 225 | - add upgrade to f32 226 | - try to restore repos in case of failed upgrade to rawhide 227 | - disable rpmfusion-*-updates when updating to rawhide 228 | - do not upgrade dnf before upgrading to rawhide 229 | - disable updates-modular when updating to rawhide 230 | 231 | * Sun Oct 27 2019 Miroslav Suchý 31.3-1 232 | - do not check if F31 is pre-release 233 | 234 | * Mon Sep 23 2019 Miroslav Suchý 31.2-1 235 | - 1747408 - reset modules before upgrading 236 | - enable modulare-testing if needed 237 | 238 | * Wed Aug 28 2019 Miroslav Suchý 31.1-1 239 | - add migration to Fedora 31 240 | - do not run tracer and needs-restarting plugins 241 | 242 | * Thu Apr 11 2019 Miroslav Suchý 30.5-1 243 | - warn when user is not running screen or tmux 244 | - improve exit banner when failure happens 245 | - package fedora-release does not need to be installed, it can be fedora- 246 | release-common 247 | 248 | * Tue Mar 19 2019 Miroslav Suchý 30.4-1 249 | - Fix the offline update path for fedora 30 250 | 251 | * Mon Mar 18 2019 Miroslav Suchý 30.3-1 252 | - unmount tmpfs when error occurs 253 | - trap Ctrl+C 254 | - accept "rawhide" as upgrade-to version 255 | - allow to upgrade to specific version 256 | - add link to common bugs 257 | - allow to mount /var/cache/dnf as tmpfs 258 | 259 | * Thu Feb 28 2019 Miroslav Suchý 30.2-1 260 | - set module_id during upgrade 261 | - add upgrade F29 to F30 262 | - remove old changelog entries 263 | - remove Group tag from spec 264 | 265 | * Wed Aug 08 2018 Miroslav Suchý 29.1-1 266 | - add upgrade from F28 to F29 267 | - Update release notes URL to point towards the correct target version 268 | 269 | * Wed Apr 18 2018 Miroslav Suchý 28.2-1 270 | - remove --distro-sync for dnf system-upgrade 271 | - do not check for dnf-plugins-core, it has been installed by check_dnf_deps() 272 | - be more verbose so we have some progress 273 | 274 | * Tue Jan 23 2018 Miroslav Suchý 28.1-1 275 | - clean caches before doing any other task 276 | - list orphans after upgrade 277 | - warn if not run as root 278 | - add upgrade to F28 and remove upgrade to F25 279 | - Remove PackageKit cache 280 | - choose better wording for reset priorities 281 | - reset services priorities the systemd way 282 | 283 | * Wed Sep 20 2017 Miroslav Suchý 27.1-1 284 | - remove old changelogs 285 | - remove upgrade from f24 286 | - Add support for Fedora 27 287 | 288 | * Thu Mar 16 2017 Miroslav Suchý 26.1-1 289 | - add upgrade to F26 290 | -------------------------------------------------------------------------------- /fedora-upgrade: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # vim: sw=3:ts=3:et 3 | set -e 4 | 5 | RAWHIDE_VERSION=43 6 | FEDORA_VERSION=$(rpm -qf --qf '%{version}' /etc/os-release) 7 | TARGET_VERSION=$((FEDORA_VERSION + 1)) 8 | UPGRADE_FINISHED=0 9 | TMPFS_MOUNTED=0 10 | DISABLED_PLUGINS="--disableplugin=needs-restarting --disableplugin=tracer" 11 | 12 | function check_installation() { 13 | [[ -e /usr/sbin/fedora-upgrade ]] 14 | } 15 | 16 | function pause() { 17 | # clear the stdin buffer and pause with question 18 | read -t 1 -n 10000 discard || [ $? -gt 128 ] 19 | read -p "Hit Enter to continue or Ctrl + C to cancel." 20 | } 21 | 22 | function continue_or_skip() { 23 | read -t 1 -n 10000 discard || [ $? -gt 128 ] 24 | echo -e $1 25 | echo "This step is highly recommended but can be safely skipped." 26 | ANSWER='XXX' 27 | while [ "$ANSWER" != "" -a "$ANSWER" != "S" ] ; do 28 | read -p "Hit Enter to continue, Ctrl + C to cancel or S + Enter to skip. " ANSWER 29 | ANSWER=$(echo $ANSWER | tr "[:lower:]" "[:upper:]") 30 | done 31 | } 32 | 33 | function dnf_install_deps() { 34 | # TODO add -q to all dnf and create some kind of progress meter 35 | # but now be verbose 36 | install_if_missing rpmconf 37 | install_if_missing dnf-plugins-core 38 | } 39 | 40 | function install_if_missing() { 41 | echo "Checking if $1 is installed." 42 | rpm -q $1 >/dev/null || dnf install -y -q $1 43 | } 44 | 45 | function upgrade_before_upgrade() { 46 | continue_or_skip "\nGoing to run 'dnf upgrade' before upgrading." 47 | if [ "$ANSWER" != "S" ] ; then 48 | dnf upgrade 49 | fi 50 | } 51 | 52 | function dnf_upgrade_before_upgrade() { 53 | continue_or_skip "\nGoing to run 'dnf upgrade' before upgrading." 54 | if [ "$ANSWER" != "S" ] ; then 55 | dnf upgrade 56 | fi 57 | } 58 | 59 | function rpmconf_before_upgrade() { 60 | continue_or_skip "\nGoing to resolve old .rpmsave and .rpmnew files before upgrading." 61 | if [ "$ANSWER" != "S" ] ; then 62 | rpmconf -fvimdiff -a 63 | fi 64 | } 65 | 66 | function import_keys() { 67 | echo "Importing new RPM-GPG keys." 68 | rpm --import /usr/share/distribution-gpg-keys/fedora/RPM-GPG-KEY-fedora-$TARGET_VERSION-primary 69 | if [ -f /etc/yum.repos.d/rpmfusion-free.repo -a -e /usr/share/distribution-gpg-keys/rpmfusion/RPM-GPG-KEY-rpmfusion-free-fedora-$TARGET_VERSION ]; then 70 | rpm --import /usr/share/distribution-gpg-keys/rpmfusion/RPM-GPG-KEY-rpmfusion-free-fedora-$TARGET_VERSION 71 | fi 72 | if [ -f /etc/yum.repos.d/rpmfusion-nonfree.repo -a -e /usr/share/distribution-gpg-keys/rpmfusion/RPM-GPG-KEY-rpmfusion-nonfree-fedora-$TARGET_VERSION ]; then 73 | rpm --import /usr/share/distribution-gpg-keys/rpmfusion/RPM-GPG-KEY-rpmfusion-nonfree-fedora-$TARGET_VERSION 74 | fi 75 | } 76 | 77 | function dnf_install_base() { 78 | continue_or_skip "\nGoing to install missing packages from group 'Minimal Install'" 79 | if [ "$ANSWER" != "S" ] ; then 80 | dnf groupupdate 'Minimal Install' 81 | fi 82 | } 83 | 84 | function rpmconf_after_upgrade() { 85 | continue_or_skip "\nGoing to resolve .rpmsave and .rpmnew files after upgrade." 86 | if [ "$ANSWER" != "S" ] ; then 87 | rpmconf -fvimdiff -a 88 | rpmconf --clean 89 | fi 90 | } 91 | 92 | function remove_old_gpg_keys() { 93 | continue_or_skip "\nGoing to remove old GPG keys." 94 | if [ "$ANSWER" != "S" ] ; then 95 | /usr/sbin/fedora-remove-old-gpg-keys || true 96 | fi 97 | } 98 | 99 | function reset_service_priorities() { 100 | continue_or_skip "\nGoing to resets all installed unit files to the defaults configured\nin the preset policy file." 101 | if [ "$ANSWER" != "S" ] ; then 102 | systemctl preset-all || true 103 | fi 104 | } 105 | 106 | function EXCEPTION_reset_libgit2_module() { 107 | continue_or_skip "\nGoing to reset libgit2, exa, bat Fedora Modules. (dnf module reset libgit2 exa bat)" 108 | if [ "$ANSWER" != "S" ] ; then 109 | dnf module reset libgit2 exa bat 110 | fi 111 | } 112 | 113 | function EXCEPTION_reset_modules() { 114 | continue_or_skip "\nGoing to reset Fedora Modules. (dnf module reset '*')" 115 | if [ "$ANSWER" != "S" ] ; then 116 | dnf module reset '*' 117 | fi 118 | } 119 | 120 | function cleanup_cache() { 121 | rm -rf /var/cache/yum/* /var/cache/dnf/* /var/cache/PackageKit/* 122 | } 123 | 124 | function unwanted_packages() { 125 | LAST=$1 126 | continue_or_skip "\nThere may be some packages which are now orphaned, do you want to see them?" 127 | if [ "$ANSWER" != "S" ] ; then 128 | RESULT=0 129 | package-cleanup --orphans | grep -v kernel && RESULT=1 130 | if [ 0$RESULT -eq 1 ]; then 131 | echo "These packages are very probably orphaned. You may want to remove them." 132 | fi 133 | fi 134 | } 135 | 136 | function unwanted_packages2() { 137 | LAST=$1 138 | continue_or_skip "\nThere may be some packages which are now retired, do you want to remove them?\nYou will confirm each removal separately." 139 | if [ "$ANSWER" != "S" ] ; then 140 | remove-retired-packages $LAST 141 | fi 142 | } 143 | 144 | function is_prerelease() { 145 | # will print string "--enablerepo=updates-testing" if this is prerelease, "" otherwise 146 | local RELEASE=$1 147 | TEMP=$(mktemp -d) 148 | dnf download -q --destdir "$TEMP" --disablerepo=* --enablerepo=fedora --releasever=$RELEASE fedora-repos 149 | if rpm2cpio "$TEMP"/fedora-repos*.rpm | cpio -i --quiet --to-stdout - ./etc/yum.repos.d/fedora-updates-testing.repo | grep 'enabled=1' >/dev/null ; then 150 | if [ -e /etc/yum.repos.d/fedora-updates-modular.repo ]; then 151 | echo "--enablerepo=updates-testing --enablerepo=updates-testing-modular" 152 | else 153 | echo "--enablerepo=updates-testing" 154 | fi 155 | else 156 | echo "" 157 | fi 158 | rm -rf "$TEMP" 159 | } 160 | 161 | function warn_if_graphics_mode() { 162 | if [[ "$TERM" =~ "screen".* || "$TERM" =~ "tmux".* ]]; then 163 | true 164 | else 165 | cat << WARNING 166 | It seems you are running upgrade from graphics mode. You should use "screen" or "tmux". 167 | Are you sure you want to continue? 168 | WARNING 169 | pause 170 | fi 171 | } 172 | 173 | function print_exit_banner() { 174 | umount_cache_dnf 175 | if [ $UPGRADE_FINISHED -eq 2 ]; then 176 | echo "Enabling updates repos back" 177 | # upgrade to rawhide failed, restore repos 178 | dnf config-manager --set-enabled fedora updates updates-testing updates-modular 179 | # FIXME we should enable 180 | # rpmfusion-free-updates rpmfusion-nonfree-updates 181 | # but only if we previously disabled it 182 | echo "Disabling rawhide repo." 183 | dnf config-manager --set-disabled rawhide 184 | UPGRADE_FINISHED=0 185 | fi 186 | if [ $UPGRADE_FINISHED -eq 1 ]; then 187 | echo 188 | echo You successfully upgraded to Fedora $TARGET_VERSION 189 | echo Reboot is strongly suggested. 190 | exit 0 191 | else 192 | echo 193 | echo Upgrade to Fedora $TARGET_VERSION was not finished! 194 | echo You can safely re-run fedora-upgrade again to start over with: 195 | echo " fedora-upgrade --upgrade-to=${TARGET_VERSION}" 196 | exit 1 197 | fi 198 | } 199 | 200 | function welcome_banner() { 201 | echo "Going to upgrade your Fedora to version $1." 202 | echo "You may want to read Release Notes:" 203 | echo " http://docs.fedoraproject.org/f${TARGET_VERSION}/release-notes/" 204 | echo "and about commond bugs:" 205 | echo " https://fedoraproject.org/wiki/Common_F${TARGET_VERSION}_bugs" 206 | pause 207 | } 208 | 209 | function warn_about_online() { 210 | echo "Warning: This is unofficial upgrade path. For official tool see:" 211 | echo " https://fedoraproject.org/wiki/Upgrading" 212 | echo " While author of fedora-upgrade thinks online upgrade is better, it is" 213 | echo " not officially tested by FedoraQA." 214 | pause 215 | } 216 | 217 | function going_to_reboot() { 218 | echo "" 219 | echo "********** End of DNF plugin output **********" 220 | echo "" 221 | echo "Download complete! The downloaded packages were saved in cache till the next" 222 | echo "successful transaction. You can remove cached packages by executing" 223 | echo "'dnf clean packages'." 224 | echo "In next step, your computer will be REBOOTED, and packages will be upgraded." 225 | pause 226 | } 227 | 228 | function choose_upgrade_method() { 229 | echo "Choose upgrade method" 230 | echo " * offline - this use dnf-plugin-system-upgrade plugin and requires two reboots" 231 | echo " - this is official upgrade method" 232 | echo " * online - this use distro-sync and require only one reboot" 233 | echo " - this is not officially tested by FedoraQA" 234 | echo "For more information see https://fedoraproject.org/wiki/Upgrading" 235 | read -t 1 -n 10000 discard || [ $? -gt 128 ] 236 | } 237 | 238 | function mount_cache_dnf() { 239 | if [ -n "$OPTS_TMPFS" ]; then 240 | mount -t tmpfs none -o "size=$OPTS_TMPFS" /var/cache/libdnf5/ 241 | TMPFS_MOUNTED=1 242 | fi 243 | } 244 | 245 | function umount_cache_dnf() { 246 | if [ -n "$OPTS_TMPFS" -a 0$TMPFS_MOUNTED -eq 1 ]; then 247 | umount /var/cache/libdnf5/ 248 | TMPFS_MOUNTED=0 249 | fi 250 | } 251 | 252 | ################################ START OF THE CODE ############################ 253 | 254 | if ! check_installation; then 255 | echo "Please install fedora-upgrade package using dnf first" 256 | exit 2 257 | fi 258 | 259 | if [ 0$UID -ne 0 ]; then 260 | echo "Error: You must be a root." 261 | echo "Run as: sudo fedora-upgrade" 262 | exit 1 263 | fi 264 | 265 | # make obvious ending for inexperienced users 266 | trap "print_exit_banner" SIGHUP SIGINT SIGTERM INT ERR 267 | 268 | # parse command line options 269 | for i in "$@"; do 270 | case $i in 271 | -u=*|--upgrade-to=*) 272 | OPTS_UPGRADE_TO="${i#*=}" 273 | TARGET_VERSION="$OPTS_UPGRADE_TO" 274 | if [ "$TARGET_VERSION" = "rawhide" ]; then 275 | TARGET_VERSION="$RAWHIDE_VERSION" 276 | fi 277 | 278 | shift # past argument=value 279 | ;; 280 | --tmpfs=*) 281 | OPTS_TMPFS="${i#*=}" 282 | shift # past argument=value 283 | ;; 284 | --help) 285 | OPTS_HELP=YES 286 | shift # past argument 287 | ;; 288 | *) 289 | # unknown option 290 | ;; 291 | esac 292 | done 293 | 294 | if [ -n "$OPTS_HELP" ]; then 295 | man fedora-upgrade | cat 296 | exit 0; 297 | fi 298 | 299 | if [ 0$TARGET_VERSION -eq 41 ]; then 300 | # Fedora 40 to 41 301 | warn_if_graphics_mode 302 | welcome_banner $TARGET_VERSION 303 | 304 | dnf_install_deps 305 | dnf_upgrade_before_upgrade 306 | rpmconf_before_upgrade 307 | import_keys 308 | 309 | dnf clean -q dbcache metadata 310 | enable_updates="" 311 | #echo "Checking if this is pre-release" 312 | #enable_updates=$(is_prerelease $TARGET_VERSION ) 313 | 314 | choose_upgrade_method 315 | echo -e $1 316 | ANSWER='XXX' 317 | while [ "$ANSWER" != "offline" -a "$ANSWER" != "online" ] ; do 318 | read -p "What is your choice? (offline/online) " ANSWER 319 | ANSWER=$(echo $ANSWER | tr "[:upper:]" "[:lower:]") 320 | done 321 | if [ "$ANSWER" == "online" ] ; then 322 | mount_cache_dnf 323 | dnf --releasever=$TARGET_VERSION --setopt=deltarpm=false --setopt=module_platform_id=platform:f$TARGET_VERSION $enable_updates $DISABLED_PLUGINS distro-sync 324 | umount_cache_dnf 325 | elif [ "$ANSWER" == "offline" ] ; then 326 | install_if_missing dnf-plugin-system-upgrade 327 | dnf system-upgrade download --setopt=module_platform_id=platform:f$TARGET_VERSION --releasever=$TARGET_VERSION 328 | going_to_reboot 329 | dnf system-upgrade reboot 330 | fi 331 | 332 | cleanup_cache 333 | rpmconf_after_upgrade 334 | reset_service_priorities 335 | unwanted_packages2 $FEDORA_VERSION 336 | remove_old_gpg_keys 337 | UPGRADE_FINISHED=1 338 | elif [ 0$TARGET_VERSION -eq 42 ]; then 339 | # Fedora 41 to 42 340 | warn_if_graphics_mode 341 | welcome_banner $TARGET_VERSION 342 | 343 | dnf_install_deps 344 | dnf_upgrade_before_upgrade 345 | rpmconf_before_upgrade 346 | import_keys 347 | 348 | dnf clean -q dbcache metadata 349 | enable_updates="" 350 | #echo "Checking if this is pre-release" 351 | #enable_updates=$(is_prerelease $TARGET_VERSION ) 352 | 353 | choose_upgrade_method 354 | echo -e $1 355 | ANSWER='XXX' 356 | while [ "$ANSWER" != "offline" -a "$ANSWER" != "online" ] ; do 357 | read -p "What is your choice? (offline/online) " ANSWER 358 | ANSWER=$(echo $ANSWER | tr "[:upper:]" "[:lower:]") 359 | done 360 | if [ "$ANSWER" == "online" ] ; then 361 | mount_cache_dnf 362 | dnf --releasever=$TARGET_VERSION --setopt=deltarpm=false --setopt=module_platform_id=platform:f$TARGET_VERSION $enable_updates $DISABLED_PLUGINS distro-sync 363 | umount_cache_dnf 364 | elif [ "$ANSWER" == "offline" ] ; then 365 | install_if_missing dnf-plugin-system-upgrade 366 | dnf system-upgrade download --setopt=module_platform_id=platform:f$TARGET_VERSION --releasever=$TARGET_VERSION 367 | going_to_reboot 368 | dnf system-upgrade reboot 369 | fi 370 | 371 | cleanup_cache 372 | rpmconf_after_upgrade 373 | reset_service_priorities 374 | unwanted_packages2 $FEDORA_VERSION 375 | remove_old_gpg_keys 376 | UPGRADE_FINISHED=1 377 | elif [ 0$TARGET_VERSION -eq 43 ]; then 378 | # Fedora 42 to 43 379 | warn_if_graphics_mode 380 | welcome_banner $TARGET_VERSION 381 | 382 | dnf_install_deps 383 | dnf_upgrade_before_upgrade 384 | rpmconf_before_upgrade 385 | import_keys 386 | 387 | dnf clean -q dbcache metadata 388 | enable_updates="" 389 | echo "Checking if this is pre-release" 390 | enable_updates=$(is_prerelease $TARGET_VERSION ) 391 | 392 | choose_upgrade_method 393 | echo -e $1 394 | ANSWER='XXX' 395 | while [ "$ANSWER" != "offline" -a "$ANSWER" != "online" ] ; do 396 | read -p "What is your choice? (offline/online) " ANSWER 397 | ANSWER=$(echo $ANSWER | tr "[:upper:]" "[:lower:]") 398 | done 399 | if [ "$ANSWER" == "online" ] ; then 400 | mount_cache_dnf 401 | dnf --releasever=$TARGET_VERSION --setopt=deltarpm=false --setopt=module_platform_id=platform:f$TARGET_VERSION $enable_updates $DISABLED_PLUGINS distro-sync 402 | umount_cache_dnf 403 | elif [ "$ANSWER" == "offline" ] ; then 404 | install_if_missing dnf-plugin-system-upgrade 405 | dnf system-upgrade download --setopt=module_platform_id=platform:f$TARGET_VERSION --releasever=$TARGET_VERSION 406 | going_to_reboot 407 | dnf system-upgrade reboot 408 | fi 409 | 410 | cleanup_cache 411 | rpmconf_after_upgrade 412 | reset_service_priorities 413 | unwanted_packages2 $FEDORA_VERSION 414 | remove_old_gpg_keys 415 | UPGRADE_FINISHED=1 416 | elif [ 0$TARGET_VERSION -eq 0$RAWHIDE_VERSION ]; then 417 | warn_if_graphics_mode 418 | echo "Going to upgrade your Fedora to rawhide." 419 | echo "Fedora $TARGET_VERSION is currently under development." 420 | echo "Are you sure?" 421 | pause 422 | 423 | dnf_install_deps 424 | rpmconf_before_upgrade 425 | 426 | install_if_missing fedora-repos-rawhide 427 | dnf config-manager --set-disabled rpmfusion-free-updates rpmfusion-nonfree-updates || true 428 | dnf config-manager --set-disabled fedora updates updates-testing updates-modular 429 | dnf config-manager --set-enabled rawhide 430 | UPGRADE_FINISHED=2 431 | dnf clean -q dbcache metadata 432 | 433 | choose_upgrade_method 434 | echo -e $1 435 | ANSWER='XXX' 436 | while [ "$ANSWER" != "offline" -a "$ANSWER" != "online" ] ; do 437 | read -p "What is your choice? (offline/online) " ANSWER 438 | ANSWER=$(echo $ANSWER | tr "[:upper:]" "[:lower:]") 439 | done 440 | if [ "$ANSWER" == "online" ] ; then 441 | mount_cache_dnf 442 | dnf --releasever=rawhide --setopt=deltarpm=false --setopt=module_platform_id=platform:f$TARGET_VERSION $DISABLED_PLUGINS distro-sync --nogpgcheck 443 | umount_cache_dnf 444 | elif [ "$ANSWER" == "offline" ] ; then 445 | install_if_missing dnf-plugin-system-upgrade 446 | dnf system-upgrade download --setopt=module_platform_id=platform:f$TARGET_VERSION --releasever=rawhide --nogpgcheck 447 | going_to_reboot 448 | dnf system-upgrade reboot 449 | fi 450 | 451 | cleanup_cache 452 | rpmconf_after_upgrade 453 | reset_service_priorities 454 | remove_old_gpg_keys 455 | unwanted_packages 456 | UPGRADE_FINISHED=1 457 | else 458 | echo Upgrading to version $TARGET_VERSION is not supported. 459 | exit 1 460 | fi 461 | print_exit_banner 462 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | --------------------------------------------------------------------------------