azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

RPM installation on RHEL 7.6 for SAP - python version

Open sschols opened this issue 6 years ago • 7 comments

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Describe the bug A clear and concise description of what the bug is.

The Azure CLI RPM package requires python3, which is not provided by RHEL 7.6 for SAP (Azure Marketplace image). The RHEL repositories provide a "python36" package, which works fine with the newer Azure CLI versions, but since the Azure CLI only has the "python3" requirement, a normal installation using yum is not possible. Instead, the package needs to be installed manually, forcing the installation to ignore the dependencies defined in the RPM. This is not a sensible solution in our automatic deployments

To Reproduce Steps to reproduce the behavior.

  • Deploy VM running RHEL7.6 for SAP in Azure
  • Try to install Azure CLI following https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-yum?view=azure-cli-latest

Expected behavior A clear and concise description of what you expected to happen.

RPM package should allow "python36" as a valid replacement for "python3", resulting in a smooth installation using yum.

Environment summary Install Method (e.g. pip, interactive script, apt-get, Docker, MSI, edge build) / CLI version (az --version) / OS version / Shell Type (e.g. bash, cmd.exe, Bash on Windows)

  • OS: RHEL 7.6 for SAP
  • Azure CLI version 2.0.80

Additional context Add any other context about the problem here.

sschols avatar Feb 03 '20 08:02 sschols

Hi @fengzhou-msft , could you please help check this ?

arrownj avatar Feb 04 '20 02:02 arrownj

Any progress on this?

I was reading up on rpm requirements, and it seems that with version 4.13, rpm supports boolean operators on requirements (https://rpm.org/user_doc/boolean_dependencies.html), which would enable something like Requires: (python3 or python36) but RHEL 7.6 currently still uses rpm 4.11, so that wouldn't really address this problem.

Second option could be to require the actual binary instead of the package, so something like Requires: /usr/bin/python3 would work as well? So that would mean changing https://github.com/Azure/azure-cli/blob/dev/scripts/release/rpm/azure-cli.spec#L9 I suppose.

sschols avatar Feb 17 '20 09:02 sschols

Any progress on this?

I was reading up on rpm requirements, and it seems that with version 4.13, rpm supports boolean operators on requirements (https://rpm.org/user_doc/boolean_dependencies.html), which would enable something like Requires: (python3 or python36) but RHEL 7.6 currently still uses rpm 4.11, so that wouldn't really address this problem.

Second option could be to require the actual binary instead of the package, so something like Requires: /usr/bin/python3 would work as well? So that would mean changing https://github.com/Azure/azure-cli/blob/dev/scripts/release/rpm/azure-cli.spec#L9 I suppose.

Thanks for the investigation. I will try your proposed solution.

fengzhou-msft avatar Feb 20 '20 16:02 fengzhou-msft

@sschols I cannot find the "python36" package provided by RHEL repositories on a RHEL 7.6 for SAP vm. Any configurations for the repository needed after the vm setup?

fengzhou-msft avatar Mar 01 '20 07:03 fengzhou-msft

@fengzhou-msft oh, sorry. Yes, it's part of the EPEL repository, which you can enable like so: yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

sschols avatar Mar 02 '20 09:03 sschols

@fengzhou-msft oh, sorry. Yes, it's part of the EPEL repository, which you can enable like so: yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

@sschols sorry for the delayed reply. I added the EPEL repository but could still not find the "python36" package. Is it related to this: https://stackoverflow.com/a/57458136/2100487

fengzhou-msft avatar Apr 21 '20 09:04 fengzhou-msft

@fengzhou-msft sorry for the delay on my part now. Yes, seems like that is the case. Just check it with a fresh install. We use a local mirror of EPEL, which still has it available, but when I use the public version, then there's no normally usable python3 > 3.3 available. I'm pretty much at a loss as what to do about it really 🤷

sschols avatar Jul 14 '20 14:07 sschols