Skip to content

Commit

Permalink
Clean dnf data before system upgrade (openshift-metal3#1573)
Browse files Browse the repository at this point in the history
It can help in case of cache and metadata issues, as well as local
dnf db shenanighans.

Also use nobest option for dnf upgrade.
  • Loading branch information
elfosardo committed Aug 24, 2023
1 parent 7e4a417 commit fece7cb
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion 01_install_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,13 @@ export ANSIBLE_VERSION=${ANSIBLE_VERSION:-"5.9.0"}
sudo sh -c "echo 'fastestmirror=1' >> /etc/dnf/dnf.conf"
sudo sh -c "echo 'max_parallel_downloads=8' >> /etc/dnf/dnf.conf"

# Refresh dnf data
# We could also use --refresh to just force metadata update
# in the upgrade command,but this is more explicit and complete
sudo dnf -y clean all

# Update to latest packages first
sudo dnf -y upgrade
sudo dnf -y upgrade --nobest

# Install additional repos as needed for each OS version
# shellcheck disable=SC1091
Expand Down Expand Up @@ -92,6 +97,13 @@ esac

sudo python -m pip install ansible=="${ANSIBLE_VERSION}"


# Hijack metal3-dev-env update module to use nobest
# during dnf upgrade
sudo dnf -y install jq
sudo python -m pip install yq
yq -iy '.[3].dnf.nobest = "true"' ${METAL3_DEV_ENV_PATH}/vm-setup/roles/packages_installation/tasks/centos_required_packages.yml

# Also need the 3.9 version of netaddr for ansible.netcommon
# and lxml for the pyxpath script
sudo python -m pip install netaddr lxml
Expand Down

0 comments on commit fece7cb

Please sign in to comment.