From 4f2613d815d86f5412ef2a67a464dfe3f7dc16ee Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Tue, 16 Feb 2021 15:36:43 +1100 Subject: [PATCH] Revert "Make sure dnf won't autoremove packages that we explicitly installed" This reverts commit b544e914945051255f87d95c5e91898fd21605a1. This work-around for very early dnf is now causing other problems building with RHEL images [1]. It's likely that the bug talked about in the original change where packages were removed despite being explicitly installed is no longer an issue. I think we can revert this now. [1] https://bugzilla.redhat.com/show_bug.cgi?id=1925243 Change-Id: I45cb4d526071a0f4c2f28a4917e4453ab08336fe --- diskimage_builder/elements/yum/bin/install-packages | 7 ------- .../elements/yum/pre-install.d/00-dnf-update | 12 ------------ 2 files changed, 19 deletions(-) delete mode 100755 diskimage_builder/elements/yum/pre-install.d/00-dnf-update diff --git a/diskimage_builder/elements/yum/bin/install-packages b/diskimage_builder/elements/yum/bin/install-packages index 218c72e64..15a5f210f 100755 --- a/diskimage_builder/elements/yum/bin/install-packages +++ b/diskimage_builder/elements/yum/bin/install-packages @@ -135,13 +135,6 @@ if [ -n "$WHITELIST" ]; then # [1] https://bugzilla.redhat.com/show_bug.cgi?id=965567 set -o xtrace ${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 $_xtrace # probably not the right place for this; but python-pip package on diff --git a/diskimage_builder/elements/yum/pre-install.d/00-dnf-update b/diskimage_builder/elements/yum/pre-install.d/00-dnf-update deleted file mode 100755 index 30560a50f..000000000 --- a/diskimage_builder/elements/yum/pre-install.d/00-dnf-update +++ /dev/null @@ -1,12 +0,0 @@ -#!/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