Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #37742 - Exclude rhn-client-tools for subman upgrade #10280

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

danmyway
Copy link

@danmyway danmyway commented Aug 19, 2024

  • Prevent rhn-client-tools from obsoleting subscription-manager by adding --setopt=exclude=rhn-client-tools during an upgrade
  • Ensure subscription-manager upgrades correctly without being replaced by rhn-client-tools

@danmyway danmyway changed the title Fixes #37742 disable obsoletes for subscription-manager upgrade Fixes #37742 - Disable obsoletes for subscription-manager upgrade Aug 19, 2024
@@ -65,7 +65,7 @@ if ! [ -x "$(command -v subscription-manager)" ] ; then
else
echo "subscription-manager is already installed!"
<% if @subman_setup_scenario == 'registration' -%>
$PKG_MANAGER_UPGRADE subscription-manager > /dev/null 2>&1
$PKG_MANAGER_UPGRADE --setopt=obsoletes=0 subscription-manager > /dev/null 2>&1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$PKG_MANAGER_UPGRADE --setopt=obsoletes=0 subscription-manager > /dev/null 2>&1
$PKG_MANAGER_UPGRADE --exclude=rhn-client-tools subscription-manager > /dev/null 2>&1

This approach seems to me a bit more directed. Using obsoletes=0 may cause unintended effects down the road if sub-man or any of its deps use obsoletes.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have this bit here:

$PKG_MANAGER_REMOVE rhn-client-tools
$PKG_MANAGER_INSTALL --setopt=obsoletes=0 subscription-manager

Right now I haven't looked at it in detail, but this PR implies that the original suggestion was insufficient.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The suggestion by @bocekm does indeed work more reliable. I'll address that in the PR.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ekohl, as far as I recall from my testing some time back removing rhn-client-tools before installing sub-man on OL 7 is not sufficient - yum says that sub-man is obsoleted by rhn-client-tools and goes ahead and installs rhn-client-tools instead of sub-man.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danmyway, perhaps you should fix the lines @ekohl mentioned above as well.

* rhn-client-tools obsoletes subscription manager, installation of
  subman rpm has the flag --setopt=obsoletes=0 set correctly to mitigate
this, but the subsequent upgrade of subscription-manager rpm does not
* add the --setopt=exclude=rhn-client-tools flag so rhn-client-tools does not
  get installed instead of upgrade of the subman

Signed-off-by: Daniel Diblik <[email protected]>
@danmyway danmyway changed the title Fixes #37742 - Disable obsoletes for subscription-manager upgrade Fixes #37742 - Exclude rhn-client-tools for subman upgrade Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants