sirjames2004
sirjames2004

Reputation: 503

Installing Azure CLI on RHEL 7.6

Having some issues installing the Azure CLI on a RHEL 7.6 VM in the Azure cloud. Been following this guide:

https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-yum?view=azure-cli-latest

I perform each step, but get this error:

Error: Package: azure-cli-2.9.1-1.el7.x86_64 (azure-cli)
           Requires: python3
Error: Package: azure-cli-2.9.1-1.el7.x86_64 (azure-cli)
           Requires: libpython3.6m.so.1.0()(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

I then tried installing just about every python3-related package at my disposal (python33.x86_64, rh-python38.x86_64, etc), but still getting the same error. I then tried the following solution:

$ sudo yum install yum-utils
$ sudo yumdownloader azure-cli
$ sudo rpm -ivh --nodeps azure-cli-2.9.1-1.el7.x86_64.rpm

Commands succeed, but running a simple 'az login' command still fails...

[root@server ~]# rpm -ivh --nodeps azure-cli-2.9.1-1.el7.x86_64.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:azure-cli-2.9.1-1.el7            ################################# [100%]
[root@server ~]# az login
/bin/az: line 2: /usr/bin/python3: No such file or directory

Any suggestions? Thanks again in advance.

Upvotes: 0

Views: 1831

Answers (1)

sirjames2004
sirjames2004

Reputation: 503

So, I just completely went around the documentation and used a pip install.

# As non-privileged user    
sudo yum install rh-python38 -y
scl enable rh-python38 bash
pip3 install --user azure-cli

All 'az' commands work flawlessly. Easy-peasy :-D

Upvotes: 1

Related Questions