3
# Copyright (C) 2013, 2016, 2017, 2019, 2020, 2021 Etersoft
4
# Copyright (C) 2013, 2016, 2017, 2019, 2020, 2021 Vitaly Lipatov <lav@etersoft.ru>
6
# This program is free software: you can redistribute it and/or modify
7
# it under the terms of the GNU Affero General Public License as published by
8
# the Free Software Foundation, either version 3 of the License, or
9
# (at your option) any later version.
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU Affero General Public License for more details.
16
# You should have received a copy of the GNU Affero General Public License
17
# along with this program. If not, see <http://www.gnu.org/licenses/>.
20
load_helper epm-release_upgrade
51
# FIXME: see epm_release_upgrade
52
epm_release_downgrade()
56
info "Starting upgrade/switch whole system to other release"
57
info "Check also http://wiki.etersoft.ru/Admin/UpdateLinux"
60
# TODO: it is possible eatmydata does not do his work
61
export EPMNOEATMYDATA=1
63
case $BASEDISTRNAME in
65
__epm_ru_update || fatal
67
# try to detect current release by repo
68
if [ "$DISTRVERSION" = "Sisyphus" ] || [ -z "$DISTRVERSION" ] ; then
70
dv="$(__detect_alt_release_by_repo)"
71
if [ -n "$dv" ] && [ "$dv" != "$DISTRVERSION" ] ; then
73
info "Detected running $DISTRNAME $DISTRVERSION (according to using repos)"
78
[ -n "$3" ] && fatal "Too many args: $*"
81
info "Force current distro version as $DISTRVERSION"
83
elif [ -n "$1" ] ; then
87
[ -n "$TARGET" ] || TARGET="$(get_prev_release $DISTRVERSION)"
91
__switch_alt_to_distro $DISTRVERSION $TARGET && info "Done. The system has been successfully downgraded to the previous release '$TARGET'."
102
info "Have no idea how to downgrade $DISTRNAME"
105
assure_exists do-release-upgrade update-manager-core
106
sudocmd do-release-upgrade
109
docmd pkcon upgrade-system "$@"
112
docmd epm install rpm yum
113
sudocmd yum clean all
115
showcmd rpm -Uvh http://mirror.yandex.ru/fedora/linux/releases/16/Fedora/x86_64/os/Packages/fedora-release-16-1.noarch.rpm
119
info "Check https://fedoraproject.org/wiki/DNF_system_upgrade for an additional info"
120
docmd epm install dnf
121
#docmd epm install epel-release yum-utils
122
sudocmd dnf --refresh upgrade
123
sudocmd dnf clean all
124
assure_exists dnf-plugin-system-upgrade
125
sudocmd dnf upgrade --refresh
126
local RELEASEVER="$1"
127
[ -n "$RELEASEVER" ] || RELEASEVER=$(($DISTRVERSION + 1))
128
#[ -n "$RELEASEVER" ] || fatal "Run me with new version"
129
confirm_info "Upgrade to $DISTRNAME/$RELEASEVER"
130
sudocmd dnf system-upgrade download --refresh --releasever=$RELEASEVER
132
# dnf system-upgrade reboot
133
# FIXME: download all packages again
134
sudocmd dnf distro-sync --releasever=$RELEASEVER
135
info "Run epm autoorphans to remove orphaned packages"
138
sudocmd urpmi.removemedia -av
139
info "Try do manually:"
140
showcmd urpmi.addmedia --distrib http://mirror.yandex.ru/mandriva/devel/2010.2/i586/
141
sudocmd urpmi --auto-update --replacefiles
146
# sudocmd zypper rr <номер_репозитория>
148
showcmd epm ar http://mirror.yandex.ru/opensuse/distribution/11.1/repo/oss 11.1oss
151
docmd epm install rpm zypper
164
sudocmd guix pull --verbose
167
fatal "Have no suitable command for $PMTYPE"