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

Unable to locate package azure-cli

Open RAJNISH3 opened this issue 4 years ago • 7 comments

Reference to Issue #15506

azure-cli is not working for me

EXECUTING THE command

RUN apt-get -y update && apt-get install azure-cli

Getting below error 0.887 Hit:1 http://security.ubuntu.com/ubuntu jammy-security InRelease #9 0.982 Hit:2 http://archive.ubuntu.com/ubuntu jammy InRelease #9 1.333 Hit:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease #9 1.685 Hit:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease #9 1.772 Reading package lists... #9 2.546 Reading package lists... #9 3.284 Building dependency tree... #9 3.460 Reading state information... #9 3.472 E: Unable to locate package azure-cli

RAJNISH3 avatar Sep 16 '22 11:09 RAJNISH3

@jiasli for awareness

yonzhan avatar Sep 16 '22 14:09 yonzhan

Please check the guide here: https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt

bebound avatar Sep 19 '22 07:09 bebound

@bebound is right.

Unable to locate package azure-cli

This error means you haven't added Microsoft Linux Repo https://packages.microsoft.com/repos/azure-cli/

jiasli avatar Sep 19 '22 08:09 jiasli

Thank you for your feedback. This has been routed to the support team for assistance.

ghost avatar Sep 19 '22 08:09 ghost

@jiasli Find below the docker image snippet

FROM ubuntu:latest ENV DEBIAN_FRONTEND noninteractive RUN apt-get -y update && apt-get install -y tcl RUN apt-get -y install git RUN apt-get -y install zip RUN apt-get -y install curl RUN apt-get install -y python-pip RUN apt-get -y update && apt-get install azure-cli

create a docker file with name Dockerfile and save the above content in file execute it, with the below command

>docker build -t image1 .

RAJNISH3 avatar Sep 19 '22 08:09 RAJNISH3

@bebound is right.

Unable to locate package azure-cli

This error means you haven't added Microsoft Linux Repo https://packages.microsoft.com/repos/azure-cli/

I have added the package as mentioned in the link but there is no specific set of commands which can be used to execute inside the docker image.

RAJNISH3 avatar Sep 22 '22 04:09 RAJNISH3

You need to execute each command in the docker.

Replace apt-get install azure-cli with apt-get install curl && curl -sL https://aka.ms/InstallAzureCLIDeb | bash in your dockerfile.

PS: This may help: https://www.cloudbees.com/blog/a-beginners-guide-to-the-dockerfile

bebound avatar Sep 22 '22 05:09 bebound