From c6b4e639b02fc6d1a4b0cc54152361b6e3034f75 Mon Sep 17 00:00:00 2001 From: Yolanda Robla Mota Date: Tue, 27 Sep 2016 10:09:35 +0200 Subject: [PATCH] Disabling all previous repos registered in the system Depending on the pool id used, so many repos are brought, including not valid ones that cause image to crash, or repos that include conflicting packages. Before enabling repos, disable all previous ones, so we can be sure that we only bring the repos specified in the parameters. Change-Id: Ifd4d8d1d4fa954cd2593669e516e3201f2d6f6c1 --- elements/rhel-common/pre-install.d/00-rhel-registration | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/elements/rhel-common/pre-install.d/00-rhel-registration b/elements/rhel-common/pre-install.d/00-rhel-registration index dcb69d8f..60c449d8 100755 --- a/elements/rhel-common/pre-install.d/00-rhel-registration +++ b/elements/rhel-common/pre-install.d/00-rhel-registration @@ -97,6 +97,8 @@ case "${REG_METHOD:-}" in echo "Attaching with options: $attach_opts" subscription-manager attach $attach_opts fi + echo "Disabling all previous repos" + subscription-manager repos --disable=\* echo "Enabling repos: $repos" subscription-manager $repos ;; @@ -108,6 +110,8 @@ case "${REG_METHOD:-}" in rpm -Uvh "$REG_SAT_URL/pub/katello-ca-consumer-latest.noarch.rpm" || true echo "Registering with options: $sanitized_opts" subscription-manager register $opts + echo "Disabling all previous repos" + subscription-manager repos --disable=\* echo "Enabling repos: $user_repos" subscription-manager $repos echo "Disabling satellite repo because it is no longer needed"