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

Unable to install azure cli on ubuntu 24

Open dharmendrasha opened this issue 1 year ago • 4 comments

Describe the bug

i am trying to install azure cli by following the official documentation but i am not able to do so because i am getting an dependency error.

this is the documentation i am following.

offficial doc

Related command

the command i am trying to run

sudo apt-get install azure-cli

Errors

Reading package lists... Done Building dependency tree... Done Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:

The following packages have unmet dependencies: azure-cli : Depends: libffi6 (>= 3.0.10~rc8) but it is not installable Depends: libssl1.1 (>= 1.1.1) but it is not installable E: Unable to correct problems, you have held broken packages.

Issue script & Debug output

Reading package lists... Done Building dependency tree... Done Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:

The following packages have unmet dependencies: azure-cli : Depends: libffi6 (>= 3.0.10~rc8) but it is not installable Depends: libssl1.1 (>= 1.1.1) but it is not installable E: Unable to correct problems, you have held broken packages.

Expected behavior

should install correctly

Environment Summary

os linux ubuntu 24

image

Additional context

i have tried to look into other issues but they are useless as well.

dharmendrasha avatar May 12 '24 11:05 dharmendrasha

Thank you for opening this issue, we will look into it.

yonzhan avatar May 12 '24 11:05 yonzhan

24.04 is not supported yet, see https://github.com/Azure/azure-cli/pull/28888

I can't repro. The error you encountered is strange. If you use one-line script, you should be able to install the Ubuntu Jammy's package. If you use step-by-step method, you will see E: The repository 'https://packages.microsoft.com/repos/azure-cli noble Release' does not have a Release file. error.

bebound avatar May 13 '24 02:05 bebound

Hello,

Somehow, I am running into a similar error message on an Azure VM running: Ubuntu 20.04.6 LTS (GNU/Linux 5.15.0-1063-azure x86_64)

more logs below

adminuser@host:~$ sudo apt update
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:2 https://packages.microsoft.com/repos/azure-cli bionic InRelease                                                  
Get:3 https://packages.microsoft.com/ubuntu/20.04/prod focal InRelease [3632 B]                                        
Hit:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease                                                         
Hit:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease                                                       
Hit:6 https://download.docker.com/linux/ubuntu focal InRelease                                                         
Hit:7 http://security.ubuntu.com/ubuntu focal-security InRelease                                                       
Hit:8 http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease         
Fetched 3632 B in 1s (4569 B/s)
Reading package lists... Done
Building dependency tree       
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.


adminuser@host:~$ apt list --upgradable
Listing... Done
azure-cli/bionic 2.60.0-1~bionic all [upgradable from: 2.43.0-1~bionic]
N: There are 130 additional versions. Please use the '-a' switch to see them.


adminuser@host:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.


adminuser@host:~$ az upgrade
This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Your current Azure CLI version is 2.43.0. Latest version available is 2.60.0.
Please check the release notes first: https://docs.microsoft.com/cli/azure/release-notes-azure-cli
Do you want to continue? (Y/n): Y
Get:1 https://packages.microsoft.com/repos/azure-cli bionic InRelease [3600 B]
Get:2 https://packages.microsoft.com/ubuntu/20.04/prod focal InRelease [3632 B]                                        
Hit:3 https://download.docker.com/linux/ubuntu focal InRelease                                                         
Hit:4 http://archive.ubuntu.com/ubuntu focal InRelease                                                                 
Hit:5 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:6 http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease
Hit:7 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:8 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Fetched 7232 B in 1s (8975 B/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 azure-cli : Depends: libffi6 (>= 3.0.10~rc8) but it is not installable
E: Unable to correct problems, you have held broken packages.
CLI upgrade failed.

nibredy avatar May 13 '24 07:05 nibredy

@nibredy You're using a Ubuntu bionic package on focal, so your repo config is wrong. Please delete /etc/apt/sources.list.d/azure-cli.list, uninstall azure-cli and follow this guide to install it again: https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?branch=main&pivots=apt

bebound avatar May 13 '24 07:05 bebound

@bebound cannot access this guid.

and i am installing this for the first time

image

dharmendrasha avatar May 14 '24 16:05 dharmendrasha

I fixed the link. Hmm, that's odd if it's your first-time installation.

bebound avatar May 15 '24 03:05 bebound