diff --git a/releasenotes/notes/dnf-support-413762b0af2887bc.yaml b/releasenotes/notes/dnf-support-413762b0af2887bc.yaml new file mode 100644 index 000000000..414c90e84 --- /dev/null +++ b/releasenotes/notes/dnf-support-413762b0af2887bc.yaml @@ -0,0 +1,5 @@ +--- +features: + - bifrost now supports ``dnf`` as package manager on RedHat-based distros. + It tries to use it by default and falls back to ``yum`` when ``dnf`` is + not available. diff --git a/scripts/install-deps.sh b/scripts/install-deps.sh index a2fdd158e..82813e7f9 100644 --- a/scripts/install-deps.sh +++ b/scripts/install-deps.sh @@ -48,9 +48,10 @@ elif [ -x '/usr/bin/apt-get' ]; then [wget]=wget ) EXTRA_PKG_DEPS=() -elif [ -x '/usr/bin/yum' ]; then +elif [ -x '/usr/bin/dnf' ] || [ -x '/usr/bin/yum' ]; then OS_FAMILY="RedHat" - INSTALLER_CMD="sudo -H yum -y install" + PKG_MANAGER=$(which dnf || which yum) + INSTALLER_CMD="sudo -H ${PKG_MANAGER} -y install" CHECK_CMD="rpm -q" PKG_MAP=( [gcc]=gcc