diff --git a/elements/yum/bin/install-packages b/elements/yum/bin/install-packages index 90b28f864..dac71738f 100755 --- a/elements/yum/bin/install-packages +++ b/elements/yum/bin/install-packages @@ -124,6 +124,13 @@ if [ -n "$WHITELIST" ]; then ${YUM} -v -y $ACTION $EXTRA_ARGS $PKGS + if [ "$ACTION" == "install" ]; then + if [ ${YUM} == "dnf" ]; then + # Make sure dnf won't autoremove these packages + dnf mark install $PKGS + fi + fi + # probably not the right place for this; but python-pip package on # fedora/rh calls pip "pip-python" while the rest of the work # expects it to be just called "pip" diff --git a/elements/yum/pre-install.d/00-dnf-update b/elements/yum/pre-install.d/00-dnf-update new file mode 100755 index 000000000..30560a50f --- /dev/null +++ b/elements/yum/pre-install.d/00-dnf-update @@ -0,0 +1,12 @@ +#!/bin/bash + +if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then + set -x +fi +set -eu +set -o pipefail + +if [[ $DISTRO_NAME == "fedora" && $DIB_RELEASE -eq 22 ]]; then + # we need dnf mark command from dnf 1.1.1, which is pretty recent + dnf --refresh update -y dnf +fi