Azure / azure-cli

Azure Command-Line Interface
MIT License
4k stars 2.98k forks source link

Unable to install azure cli on ubuntu 24 #28945

Open dharmendrasha opened 5 months ago

dharmendrasha commented 5 months ago

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.

yonzhan commented 5 months ago

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

bebound commented 5 months ago

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.

nibredy commented 5 months ago

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.
bebound commented 5 months ago

@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

dharmendrasha commented 5 months ago

@bebound cannot access this guid.

and i am installing this for the first time

image

bebound commented 5 months ago

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