azure-cli: azure-cli fails to install on CentOS 8

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

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

To Reproduce

[root@6e5b7a6907ed /]# yum install azure-cli
Failed to set locale, defaulting to C
CentOS-8 - AppStream                                                               2.4 MB/s | 6.0 MB     00:02
CentOS-8 - Base                                                                    1.2 MB/s | 7.9 MB     00:06
CentOS-8 - Extras                                                                  639  B/s | 2.1 kB     00:03
Azure CLI                                                                          4.3 MB/s |  11 MB     00:02
Last metadata expiration check: 0:00:01 ago on Mon Oct 14 17:14:55 2019.
Error:
 Problem: cannot install the best candidate for the job
  - nothing provides python needed by azure-cli-2.0.74-1.el7.x86_64
  - nothing provides python-virtualenv needed by azure-cli-2.0.74-1.el7.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

[root@6e5b7a6907ed /]# yum whatprovides python
Failed to set locale, defaulting to C
Last metadata expiration check: 0:01:04 ago on Mon Oct 14 17:14:55 2019.
Error: No Matches found
[root@6e5b7a6907ed /]# yum whatprovides python3
Failed to set locale, defaulting to C
Last metadata expiration check: 0:01:18 ago on Mon Oct 14 17:14:55 2019.
python36-3.6.8-2.module_el8.0.0+33+0a10c0e1.x86_64 : Interpreter of the Python programming language
Repo        : AppStream
Matched from:
Provide    : python3 = 3.6.8-2.module_el8.0.0+33+0a10c0e1

Expected behavior azure-cli will be successfully installed in a CentOS 8x container.

Environment summary Followed the instructions on https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-yum?view=azure-cli-latest and installed azure-cli with yum.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (5 by maintainers)

Most upvoted comments

@pkoziol change of plan. We have this PR #11275 to build el7 package with Python 3. It would support Centos 8/RHEL 8 already. I’m going to revert el8 #11325

It’s time to build an el8 package with Python 3.

I too got somewhat same error, and python 2.x should not be solution for it since it is going out of service in few weeks.

[/work/demo]$ sudo yum install azure-cli CentOS-8 - AppStream 1.8 kB/s | 4.3 kB 00:02 CentOS-8 - Base 1.7 kB/s | 3.9 kB 00:02 CentOS-8 - Extras 701 B/s | 1.5 kB 00:02 Azure CLI 2.4 kB/s | 2.9 kB 00:01 Extra Packages for Enterprise Linux 8 - x86_64 14 kB/s | 19 kB 00:01 google-chrome 1.1 kB/s | 1.3 kB 00:01 Error: Problem: cannot install the best candidate for the job

  • nothing provides python needed by azure-cli-2.0.75-1.el7.x86_64
  • nothing provides python-virtualenv needed by azure-cli-2.0.75-1.el7.x86_64 (try to add ‘–skip-broken’ to skip uninstallable packages or ‘–nobest’ to use not only best candidate packages) [/work/demo]$

Red Hat Enterprise Linux 8 systems are not officially supported yet. You can follow the workaround for now:

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

Then edit the second line of /usr/bin/az (result of which az) to specify using python2: PYTHONPATH=/usr/lib64/az/lib/python2.7/site-packages python2 -sm azure.cli "$@"