mirror of
https://github.com/rocky-linux/rocky-tools.git
synced 2024-11-25 06:31:24 +00:00
Dump DNF cache before collecting system data and dnf update instead of after.
If there's going to be errors due to corrupted repos, etc we want to find out right away so we can bail before we put the system in an unstable state. To this end we dump the dnf cache right away to make sure that dnf is forced to hit the repos insteada of relying on cached data.
This commit is contained in:
parent
6ee3330480
commit
bc7a35a1e7
@ -358,6 +358,9 @@ safednf () (
|
|||||||
)
|
)
|
||||||
|
|
||||||
collect_system_info () {
|
collect_system_info () {
|
||||||
|
# Dump the DNF cache first so we start with a clean slate.
|
||||||
|
infomsg $'\nRemoving dnf cache\n'
|
||||||
|
rm -rf /var/cache/{yum,dnf}
|
||||||
# Check the efi mount first, so we can bail before wasting time on all these
|
# Check the efi mount first, so we can bail before wasting time on all these
|
||||||
# other checks if it's not there.
|
# other checks if it's not there.
|
||||||
if [[ $update_efi ]]; then
|
if [[ $update_efi ]]; then
|
||||||
@ -725,8 +728,6 @@ EOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Distrosync
|
# Distrosync
|
||||||
infomsg $'\nRemoving dnf cache\n'
|
|
||||||
rm -rf /var/cache/{yum,dnf}
|
|
||||||
infomsg $'Ensuring repos are enabled before the package swap\n'
|
infomsg $'Ensuring repos are enabled before the package swap\n'
|
||||||
safednf -y --enableplugin=config-manager config-manager \
|
safednf -y --enableplugin=config-manager config-manager \
|
||||||
--set-enabled "${!repo_map[@]}" || {
|
--set-enabled "${!repo_map[@]}" || {
|
||||||
|
Loading…
Reference in New Issue
Block a user