azure-cli
azure-cli copied to clipboard
Azure CLI package installation fails on Azure RHEL 8.5 PAYG VM
az feedbackauto-generates most of the information requested below, as of CLI version 2.0.62
Related command sudo dnf install azure-cli
Describe the bug When attempting to install the azure-cli package (RPM) on an Azure RHEL 8.5 PAYG VM it fails due to a conflict with the azure-security package that is already installed.
To Reproduce
-
Provision a RHEL 8.5 PAYG VM on Azure.
-
The VM already has the azure-security package installed:
$ sudo dnf info azure-security
Last metadata expiration check: 1:16:08 ago on Wed 17 Aug 2022 08:52:46 AM UTC.
Installed Packages
Name : azure-security
Version : 2.20.2
Release : 58
Architecture : x86_64
Size : 84 M
Source : azure-security-2.20.2-58.src.rpm
Repository : @System
Summary : Azure security scanning daemon
URL : www.microsoft.com
License : Apache
Description : Azure security scanning daemon
- The VM does not have the azure-cli package installed:
$ sudo dnf info azure-cli
Last metadata expiration check: 1:16:23 ago on Wed 17 Aug 2022 08:52:46 AM UTC.
Available Packages
Name : azure-cli
Version : 2.39.0
Release : 1.el8
Architecture : x86_64
Size : 50 M
Source : azure-cli-2.39.0-1.el8.src.rpm
Repository : packages-microsoft-com-prod
Summary : Azure CLI
URL : https://docs.microsoft.com/cli/azure/install-azure-cli
License : MIT
Description : A great cloud needs great tools; we're excited to introduce Azure CLI,
: our next generation multi-platform command line experience for Azure.
- Try to install the azure-cli package (which fails):
$ sudo dnf install azure-cli
Last metadata expiration check: 1:17:19 ago on Wed 17 Aug 2022 08:52:46 AM UTC.
Dependencies resolved.
===================================================================================================================================================================================================================
Package Architecture Version Repository Size
===================================================================================================================================================================================================================
Installing:
azure-cli x86_64 2.39.0-1.el8 packages-microsoft-com-prod 50 M
Installing dependencies:
python39 x86_64 3.9.7-1.module+el8.6.0+12577+62b8d0a1 rhui-rhel-8-for-x86_64-appstream-rhui-rpms 33 k
python39-libs x86_64 3.9.7-1.module+el8.6.0+12577+62b8d0a1 rhui-rhel-8-for-x86_64-appstream-rhui-rpms 8.2 M
python39-pip-wheel noarch 20.2.4-7.module+el8.6.0+13003+6bb2c488 rhui-rhel-8-for-x86_64-appstream-rhui-rpms 1.1 M
python39-setuptools-wheel noarch 50.3.2-4.module+el8.5.0+12204+54860423 rhui-rhel-8-for-x86_64-appstream-rhui-rpms 497 k
Installing weak dependencies:
python39-pip noarch 20.2.4-7.module+el8.6.0+13003+6bb2c488 rhui-rhel-8-for-x86_64-appstream-rhui-rpms 1.9 M
python39-setuptools noarch 50.3.2-4.module+el8.5.0+12204+54860423 rhui-rhel-8-for-x86_64-appstream-rhui-rpms 871 k
Enabling module streams:
python39 3.9
Transaction Summary
===================================================================================================================================================================================================================
Install 7 Packages
Total download size: 63 M
Installed size: 750 M
Is this ok [y/N]: y
Downloading Packages:
(1/7): azure-cli-2.39.0-1.el8.x86_64.rpm 30 MB/s | 50 MB 00:01
(2/7): python39-setuptools-wheel-50.3.2-4.module+el8.5.0+12204+54860423.noarch.rpm 287 kB/s | 497 kB 00:01
(3/7): python39-setuptools-50.3.2-4.module+el8.5.0+12204+54860423.noarch.rpm 487 kB/s | 871 kB 00:01
(4/7): python39-pip-20.2.4-7.module+el8.6.0+13003+6bb2c488.noarch.rpm 3.5 MB/s | 1.9 MB 00:00
(5/7): python39-libs-3.9.7-1.module+el8.6.0+12577+62b8d0a1.x86_64.rpm 12 MB/s | 8.2 MB 00:00
(6/7): python39-pip-wheel-20.2.4-7.module+el8.6.0+13003+6bb2c488.noarch.rpm 3.1 MB/s | 1.1 MB 00:00
(7/7): python39-3.9.7-1.module+el8.6.0+12577+62b8d0a1.x86_64.rpm 14 kB/s | 33 kB 00:02
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 15 MB/s | 63 MB 00:04
Running transaction check
Transaction check succeeded.
Running transaction test
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: Transaction test error:
file /usr/lib/.build-id/96/652dd4786fcd6016a4c0f82e3072bf8cbdfab6 from install of azure-cli-2.39.0-1.el8.x86_64 conflicts with file from package azure-security-2.20.2-58.x86_64
Expected behavior The package should have installed.
Environment summary RHEL 8.5 OS (from Azure PAYG)
Additional context N/A
@jiasli for awareness
Azure CLI RPM can be successfully installed on RHEL container: https://github.com/Azure/azure-cli/blob/bb28eea93ff29033e32ba03aef4783784a737cfa/azure-pipelines.yml#L641
I saw the error is
file /usr/lib/.build-id/96/652dd4786fcd6016a4c0f82e3072bf8cbdfab6 from install of azure-cli-2.39.0-1.el8.x86_64 conflicts with file from package azure-security-2.20.2-58.x86_64
However, I am not aware Azure CLI installs /usr/lib/.build-id/96/652dd4786fcd6016a4c0f82e3072bf8cbdfab6. We will do some investigation on where the conflict comes from.
rpm -qlp azure-cli-2.40.0-1.el8.x86_64.rpm | grep /usr/lib/.build-id/96/652dd4786fcd6016a4c0f82e3072bf8cbdfab6 indicates that azure-cli does contains this file. It looks that these two packages contain same binary files so the build_id files conflict.
It can be disabled by %define _build_id_links none. I'll create a fix for this.
Similar issue: https://github.com/microsoft/vscode/pull/116105
Adding a +1 for this; I have the same issue.
Updates on this? Been a few months and still having this error.
+1, but I have a workaround I've tested on a clean install of RHEL 8.6 - install azure-cli, wait for it to fail, remove azure-security, then install azure-cli once more - it should then work. So,
set +euo pipefail
sudo dnf install -y azure-cli
sudo dnf remove -y azure-security
sudo dnf install -y azure-cli
set -euo pipefail
Hope this helps.
FYI. I am getting this conflict now:
# yum install azure-cli
Updating Subscription Management repositories.
Repository microsoft-edge is listed more than once in the configuration
Last metadata expiration check: 0:00:46 ago on Wed 01 May 2024 11:05:16 PM UTC.
Dependencies resolved.
==========================================================================================================================================================================================================================================
Package Architecture Version Repository Size
==========================================================================================================================================================================================================================================
Installing:
azure-cli x86_64 2.60.0-1.el9 microsoft-prod 34 M
Transaction Summary
==========================================================================================================================================================================================================================================
Install 1 Package
Total download size: 34 M
Installed size: 458 M
Is this ok [y/N]: y
Downloading Packages:
azure-cli-2.60.0-1.el9.x86_64.rpm 9.7 MB/s | 34 MB 00:03
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 9.7 MB/s | 34 MB 00:03
Running transaction check
Transaction check succeeded.
Running transaction test
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'yum clean packages'.
Error: Transaction test error:
file /usr/lib/.build-id/70/e32f6b4c4800da2508b2effef36317496b3985 from install of azure-cli-2.60.0-1.el9.x86_64 conflicts with file from package datadog-agent-1:7.53.0-1.x86_64'''
# ls -l /usr/lib/.build-id/70/e32f6b4c4800da2508b2effef36317496b3985
lrwxrwxrwx 1 root root 121 Apr 29 11:41 /usr/lib/.build-id/70/e32f6b4c4800da2508b2effef36317496b3985 -> ../../../../opt/datadog-agent/embedded/lib/python3.11/site-packages/charset_normalizer/md.cpython-311-x86_64-linux-gnu.so
The issue I have found is down to the version of the datadog agent you have installed (1:7.53.0-1.x86_64) - Downgrade to 7.52.1 (datadog-agent-1:7.52.1-1.x86_64) and you should be able to install the Azure CLI with no issues.
... and I did that, but that's not a long-term solution, of course.
Which package is to 'blame' for this conflict?
In all of the searching I've done, azure-cli seems to be the common factor.
I raised an issue with Datadog - they have their engineers looking into it. I have asked for an ETA - hopefully hear from them soon.
@bchill - there is a work around if you want to use 7.53.0 - add --excludepath=/usr/lib/.build-id/ in the install script as an argument - or you can wait for 7.54.0 which will be released shortly.