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

Documentation: RPM Package does not support RHEL/CentOS 6

Open linuxelf001 opened this issue 9 years ago • 20 comments

Following the instructions, (https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest#install-on-rhel-fedora-and-centos-with-yum), I installed Azure CLI on RHEL 6.8 VM.

It installs azure-cli.x86_64 0:2.0.18-1.el7 on RHEL 6.x VM.

After the installation, it fails to load with below message az /usr/lib64/az/bin/python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory

python --version Python 2.6.6

  • Do we have separate Azure CLI rpm available for EL6?
  • Any plans to include Azure CLI support for Python 2.6.6?

Environment summary

Install Method: How did you install the CLI? (e.g. pip, interactive script, apt-get, Docker, MSI, nightly) yum

OS Version: What OS and version are you using?

cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.8 (Santiago)

uname -a Linux rhel68 2.6.32-642.15.1.el6.x86_64 #1 SMP Mon Feb 20 02:26:38 EST 2017 x86_64 x86_64 x86_64 GNU/Linux

Shell Type: What shell are you using? (e.g. bash, cmd.exe, Bash on Windows)
Bash

linuxelf001 avatar Sep 29 '17 01:09 linuxelf001

We don't plan to support Python 2.6 at this point.

troydai avatar Sep 29 '17 16:09 troydai

If I install Python 2.7 from source code on RHEL/Centos 6.x VM, yum would not know it and it would fail the Azure CLI installation.

--> Processing Dependency: libpython2.7.so.1.0()(64bit) for package: azure-cli-2.0.18-1.el7.x86_64.

Any plans to make Python 2.7/3.5 rpm and offer as a solution for Azure CLI installation on RHEL/Centos 6.x?

linuxelf001 avatar Sep 30 '17 23:09 linuxelf001

@derekbekoe can you answer the question for RPM? My understanding is that we do offer azure-cli on RPM since 2.0.18.

troydai avatar Oct 03 '17 16:10 troydai

We do offer azure-cli as an RPM but it supports RHEL/CentOS 7.x. RHEL/CentOS 6.x ships with Python 2.6 and we require at least Python 2.7.

Any plans to make Python 2.7/3.5 rpm and offer as a solution for Azure CLI installation on RHEL/Centos 6.x?

We don't plan to create a Python RPM for 6.x. If you can install Python 2.7/3.5/3.6 on the machine, you can install the CLI with pip install azure-cli assuming you have the native dependencies installed from https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest#a-namelinuxinstall-on-linux-without-apt-get.

derekbekoe avatar Oct 03 '17 17:10 derekbekoe

do you provide the src.rpm for the azure-cli in order to try to rebuild it with the SCL provided python2.7 version on CentOS/RHEL/SL 6.x ?

truatpasteurdotfr avatar Oct 03 '17 17:10 truatpasteurdotfr

We do not provide src.rpm but the build instructions are here so you can build a src.rpm - https://github.com/Azure/azure-cli/tree/master/packaged_releases/rpm.

derekbekoe avatar Oct 03 '17 22:10 derekbekoe

thx, I will have a look!

truatpasteurdotfr avatar Oct 04 '17 17:10 truatpasteurdotfr

some progress, but not there yet https://gist.github.com/truatpasteurdotfr/bad17290a66046a950ac20833d7ed2ac

truatpasteurdotfr avatar Oct 04 '17 18:10 truatpasteurdotfr

@sptramer Can we modify install instructions to highlight the RPM package supports RHEL/CentOS 7 - https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest#install-on-rhel-fedora-and-centos-with-yum?

derekbekoe avatar Oct 09 '17 17:10 derekbekoe

cc: @JasonRShaver

derekbekoe avatar Oct 09 '17 18:10 derekbekoe

@derekbekoe Rather than a specific Linux distribution, is there an rpm/yum version which the package is explicitly compatible with? This allows us to avoid install-by-distribution and instead focus on install-by-manager.

EDIT: Just noticed this is likely a python compatibility error (what distribution still services 2.6, which has security problems???) so will update the install instructions appropriately.

sptramer avatar Oct 09 '17 18:10 sptramer

Not really. It works on RHEL/CentOS 7 but not 6. Not sure what specific rpm, yum versions but the OS version would be the main indication.

derekbekoe avatar Oct 09 '17 18:10 derekbekoe

@truatpasteurdotfr - The instructions have been updated to reflect the fact that the CLI depends on Python 2.7 or later. Since Python 2.7 includes critical security fixes and is the end-of-life release of the 2.x series, I would recommend you update your RHEL distribution or find an external repository with packages compatible with RHEL 6.

After updating your Python, libffi, and OpenSSL to their latest available versions, please try installing the CLI again. We are working on finding the minimum required FFI and OpenSSL versions.

sptramer avatar Oct 09 '17 18:10 sptramer

Thanks @sptramer. Closing as documentation has been updated.

derekbekoe avatar Oct 10 '17 00:10 derekbekoe

just FYI: https://www.softwarecollections.org/en/scls/rhscl/python27/ there is a "supported" way to install python2.7 on RHEL6 clones :)

truatpasteurdotfr avatar Oct 10 '17 18:10 truatpasteurdotfr

quick and dirty by removing the debuginfo creation... ymmv http://dl.pasteur.fr/fop/LskIyBWt/python27-azure-cli-2.0.16-1.centos6_scl_rh.tgz (unsigned rpm, src.rpm provided with spec file and build command/log) if someone care to try... I don't have any azure account.

truatpasteurdotfr avatar Oct 10 '17 19:10 truatpasteurdotfr

I'm also facing this issue on RHEL 6.8:

[root@RM-HQ-PUP ~]# scl enable python27 bash
[root@RM-HQ-PUP ~]# python --version
Python 2.7.8
[root@RM-HQ-PUP ~]# az
Could not import runpy module
[root@RM-HQ-PUP ~]# yum list installed | grep azure
azure-cli.x86_64                     2.0.22-1.el7         @azure-cli
[root@RM-HQ-PUP ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.8 (Santiago)

walterheck avatar Dec 13 '17 11:12 walterheck

you can't run an el7 rpm on el6... you could try rpm built on c6/devtoolset.

truatpasteurdotfr avatar Dec 13 '17 14:12 truatpasteurdotfr

Eventually got it to work by using SCL. A rough outline from the top of my head for others to follow: scl enable python27 bash yum install python27-python-pip python27-python-devel pip install --upgrade pip pip install azure-cli

Might be worth adding to the docs?

walterheck avatar Dec 13 '17 15:12 walterheck

the (possible/likely to happen) issue with "pip install" is that you can be replacing files from the packaged python27-python-pip* , which might be reversed when you upgrade theses SCL packages...

truatpasteurdotfr avatar Dec 20 '17 09:12 truatpasteurdotfr