Describe the bug
Azure Cli on 18.04 WLS Windows 10 won't install
To Reproduce
Install 18.04 from Windows 10 Store
Update and upgrade 18.04
sudo apt-get update && sudo apt-get install azure-cli
Output
Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [83.2 kB]
Hit:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Get:5 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [62.5 kB]
Get:6 http://security.ubuntu.com/ubuntu bionic-security/main Translation-en [23.0 kB]
Get:7 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [80.9 kB]
Get:8 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [32.4 kB]
Fetched 365 kB in 7s (53.5 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package azure-cli
Expected behavior
Azure Cli package should be located.
Environment summary
Followed instructions here: https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-apt?view=azure-cli-latest
Additional context
Add any other context about the problem here.
@rajurs according to the output, the APT didn't visit https://packages.microsoft.com/repos/azure-cli/. Could you double check if the source list is updated correctly?
Closing due to inactivity.
This happens if you are following instructions (https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-apt?view=azure-cli-latest) but miss a step.
When using the copy button for bash commands on the web page, and pasting it in bash, sometime it is possible that the last command in the group is not executed because an enter wasn't pressed. In my case, AZ_REPO wasn't set properly.
Note that after setting the AZ_REPO variable as explained by @YasserAsmi, you also have to re-run the sudo apt-get update command before sudo apt-get install azure-cli will resolve the azure-cli package location.
Most helpful comment
Note that after setting the
AZ_REPOvariable as explained by @YasserAsmi, you also have to re-run thesudo apt-get updatecommand beforesudo apt-get install azure-cliwill resolve theazure-clipackage location.