Is your feature request related to a problem? Please describe.
az cli
can't be installed on Ubuntu 20.04 using apt
after referring to official method, as right after apt update
user will be greeted with following error:
E: The repository 'https://packages.microsoft.com/repos/azure-cli focal Release' does not have a Release file.
As I originally pointed out in https://github.com/Azure/azure-cli/issues/9585#issuecomment-608319542, only way to install it is to resort to a hack which is to add an older Ubuntu release to /etc/apt/sources.list.d/azure-cli.list
file. i.e:
deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ disco main
Which will then lead to other problems as discovered in: https://github.com/Azure/azure-cli/issues/13030#issuecomment-615547689
Describe the solution you'd like
As someone who used to create various Debian packages and handle custom repositories. Since last Ubuntu release libffi6
is availability for is 19.04, I would simply repackage this package for 20.04 and upload it as such to https://packages.microsoft.com/repos/azure-cli
repo. After adding support for focal
release for the repository, you've solved the problem of inability to have az cli
installed and all of its features fully working on >= Ubuntu 20.04.
Describe alternatives you've considered
I would encourage you as a company to give az cli snap more attention, as one such packaging format could've solve all the problem mentioned here. I had a similar problem with my Python app which I addressed by creating a snap.
Additional context
None, please inform me if you have any additional questions and/or comments.
@fengzhou-msft please take a look
My current workaround is a pair of hacks to install the latest pre-packaged version on focal / 20.04:
# 1. Override the installer script to hardcode `eoan` package source:
curl -sL https://aka.ms/InstallAzureCLIDeb | sed 's/${CLI_REPO}/eoan/g;' | bash;
# 2. Add a symlink to make it appear that libffi 6 is installed:
cd /lib/x86_64-linux-gnu;
ln -s libffi.so.7.1.0 libffi.so.6;
My current workaround is a pair of hacks to install the latest pre-packaged version on focal / 20.04:
# 1. Override the installer script to hardcode `eoan` package source: curl -sL https://aka.ms/InstallAzureCLIDeb | sed 's/${CLI_REPO}/eoan/g;' | bash; # 2. Add a symlink to make it appear that libffi 6 is installed: cd /lib/x86_64-linux-gnu; ln -s libffi.so.7.1.0 libffi.so.6;
From WSL2 20.04 (upgraded from 18.04), I had to make the change in /usr/lib/x86_64-linux-gnu
@hajekj : Ah, yes. I'm running az from inside a Linux Docker container, and Docker runs a Linux VM behind the scenes. On a true Linux system, Ubuntu's /lib is a symbolic link to /usr/lib:
lrwxrwxrwx 1 root root 7 Apr 23 06:06 /lib -> usr/lib/
I don't think there's any translation of symlinks from *NIX filesystems to NTFS, so it's not surprising that you had to go to /usr/lib
to find the file in WSL.
Also came across this issue. Is there a fix? I'm currently using azure-cli
in a container as a temporary solution.
Looking for any update on this as having same issue here
Using the eoan
install instructions above worked initially but then was unable to install az extensions properly. I ended up falling back to the script install.
I'm experiencing the same issue.
Same issue here. The workarounds to get the package to install works but leaves you with an azure-cli that cannot install extensions. I've gotten things to work by creating my own python virutalenv and running pip install azure-cli
instead since this doesn't try to do any weird distro version checks but this leaves me with only being able to run az
commands when I am in that virtualenv so it's not an amazing workaround :(
@jsturtevant, @ms-lolo: When I install azure-cli
as described in my first comment above, I am able to install and use extensions. When you say you can't install extensions, what do you mean? It tells you that it can't? It throws errors when you try to install extensions? Extensions install but throw errors when you try to use them?
Wondering why I didn't have the same problem...Have you tried wading through the output of the install command and looking for errors?
az extension add --name azure-devops --debug
(feel free to install any other extension, azure-devops
is just an example).
@jsturtevant: the method I posted above _is_ the script install you said you ended up falling back to. Can you explain what you meant? If you don't modify the script it'll error out because there is no focal package available. And if you do modify it to pull a prior version, you still need to satisfy the libffi
dependency.
@jetzerb you're right. I was missing the libffi.so.6
and adding that let extensions install fine. but I don't think I'm ok leaving that fix in place. I don't feel comfortable making that symlink part of the process of provisioning production machines. I'm going to hold off and keep using the virtualenv until the deb package is fixed.
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo ...
Not a habit you want to get into!
I'm also running into this issue.
Same issue here running Ubuntu 20.04 in WSL2
I am also running into issues as my packages on the Ubuntu 20.04 LTS are failing to upgrade with the below error:
E: The repository 'https://packages.microsoft.com/repos/azure-cli focal Release' does not have a Release file.
Please do let us know the ETA when this will be available on Ubuntu 20.04 LTS.
Focal package released for azure-cli 2.6.0. Please try again.
FYI: I'm indeed able to install the 2.6.0 version on Ubuntu 20.04 LTS, via:
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
. Thanks.
Focal package released for azure-cli 2.6.0. Please try again.
Thank you, I can confirm this adds proper support for Ubuntu 20.04.
Most helpful comment
Focal package released for azure-cli 2.6.0. Please try again.