linux-package-repositories icon indicating copy to clipboard operation
linux-package-repositories copied to clipboard

packages-microsoft-prod.rpm for el9 installable on el8

Open Klaas- opened this issue 8 months ago • 0 comments

Describe the issue

Hi, I've recently had an issue with a customer; they tried to install azure-cli on their RHEL8 system, they followed the docs: https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=dnf

sadly they followed them line by line without reading too much :) so what they did at the end was install the el9 package on el8: sudo dnf install -y https://packages.microsoft.com/config/rhel/9.0/packages-microsoft-prod.rpm

That actually did work, and they could even install the azure-cli el9 package. But that repository includes other packages, also some with improper rpm dependencies which lead to a different error in subsequent dnf update commands. This left me wondering why allow that package to be installed at all? :)

I am guessing the easiest way to keep this from happening is to set a Requires within the spec that builds this package on system-release(releasever)

C8S https://gitlab.com/redhat/centos-stream/rpms/centos-release/-/blob/88a0121e46cfe7501ddecc4fbef9710e24c44c11/centos-release.spec#L45 C9S https://gitlab.com/redhat/centos-stream/rpms/centos-release/-/blob/2e8259a53fcf1fe43b29d07a48e3686e75d6a6fd/centos-stream-release.spec#L26

redhat-release also does that as well, same for almalinux-release

Alma8 https://git.almalinux.org/rpms/almalinux-release/src/commit/76bfe3239140df0b4ad9ec95175523797c490c98/almalinux-release.spec#L29 Alma9 https://git.almalinux.org/rpms/almalinux-release/src/commit/3dbcc69913a5a31538b0ac594c06515324d553a8/almalinux-release.spec

That way you could not install a el9 package on an el8 system and vice versa.

Steps to Reproduce run sudo dnf install -y https://packages.microsoft.com/config/rhel/9.0/packages-microsoft-prod.rpm on el8 system

Actual Result installs

Expected Result should not install

Klaas- avatar Nov 17 '23 15:11 Klaas-