mirror of
https://github.com/rocky-linux/rocky-tools.git
synced 2024-11-22 05:01:25 +00:00
Attempt to run dnf update before the migration (#58)
* Attempt to run dnf update before the migration. While a migration will generally work without first running dnf update, thera are several advantages of attempting to run an update first: * We catch corner cases that an update will solve. * Since we're running a distro-sync at the end, it effectively updates anyways and the same things that will break a distro-sync will often times break an update. By attempting to run the update first we will discover those breakages before we put the system into an unstable state and we can bail out if the update fails, preventing a potentially disastrous outcome.
This commit is contained in:
parent
898ad7f3ea
commit
ac6fbedc21
@ -560,6 +560,14 @@ generate_rpm_info() {
|
|||||||
rpm -Va | sort -k3 > "${convert_info_dir}/$HOSTNAME-rpm-list-verified-$1.log"
|
rpm -Va | sort -k3 > "${convert_info_dir}/$HOSTNAME-rpm-list-verified-$1.log"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Run a dnf update before the actual migration.
|
||||||
|
pre_update() {
|
||||||
|
infomsg '%s\n' "Running dnf update before we attempt the migration."
|
||||||
|
dnf -y update || exit_message \
|
||||||
|
$'Error running pre-update. Stopping now to avoid putting the system in an\n'\
|
||||||
|
$'unstable state. Please correct the issues shown here and try again.'
|
||||||
|
}
|
||||||
|
|
||||||
package_swaps() {
|
package_swaps() {
|
||||||
# Save off any subscription-manger keys, just in case.
|
# Save off any subscription-manger keys, just in case.
|
||||||
if ( shopt -s failglob dotglob; : "$sm_ca_dir"/* ) 2>/dev/null ; then
|
if ( shopt -s failglob dotglob; : "$sm_ca_dir"/* ) 2>/dev/null ; then
|
||||||
@ -846,6 +854,7 @@ fi
|
|||||||
if [[ $convert_to_rocky ]]; then
|
if [[ $convert_to_rocky ]]; then
|
||||||
collect_system_info
|
collect_system_info
|
||||||
establish_gpg_trust
|
establish_gpg_trust
|
||||||
|
pre_update
|
||||||
package_swaps
|
package_swaps
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user