mirror of
https://github.com/ovh/the-bastion.git
synced 2025-01-04 06:27:11 +08:00
fix: packages-check.sh: centos: ensure cache is up to date before trying to install packages
This commit is contained in:
parent
5920b09aed
commit
1b04b800b8
1 changed files with 8 additions and 2 deletions
|
@ -93,9 +93,15 @@ elif echo "$DISTRO_LIKE" | grep -q -w rhel; then
|
|||
sed -i -e 's/enabled=.*/enabled=1/g' /etc/yum.repos.d/$repo.repo
|
||||
done
|
||||
fi
|
||||
yum install -y epel-release
|
||||
if command -v dnf >/dev/null; then
|
||||
dnf_or_yum=dnf
|
||||
else
|
||||
dnf_or_yum=yum
|
||||
fi
|
||||
$dnf_or_yum makecache
|
||||
$dnf_or_yum install -y epel-release
|
||||
# shellcheck disable=SC2086
|
||||
yum install -y $wanted_list
|
||||
$dnf_or_yum install -y $wanted_list
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue