Ubuntu 18.04 returns “not found” for Azure CLI install via apt

A quick note for anyone else who encounters this issue…

Recently I tried to install the Azure CLI via apt following the steps in “Install Azure CLI with apt”, I received the error “source not found”, even after modifying my sources list as described in the article.

When I enumerated the sources.list on my Ubuntu 18.04 LTS build, I felt like the list was a little shorter than it should be.

cat /etc/apt/sources.list

Frustrating, to say the least. This was my Ubuntu 18.04 LTS from Canonical, created via the new ‘”Quick Create” experience on Windows 10.

The Fix

After reading the issues others had with this in Github comment threads with no fix, I quickly decided to go back to basics.

To resolve the issue, I tried replacing my sources.list file from a known good source of the default sources.list file, as shown below.

Backup the original /etc/apt/sources.list

sudo mv /etc/apt/sources.list /etc/apt/sources.list.backup

Download my updated /etc/apt/sources.list

cd /etc/apt/
sudo wget https://gist.githubusercontent.com/h0bbel/4b28ede18d65c3527b11b12fa36aa8d1/raw/a4ab1c13a92171822215143b1e3b3eb6add7a78d/sources.list">https://gist.githubusercontent.com/h0bbel/4b28ede18d65c3527b11b12fa36aa8d1/raw/a4ab1c13a92171822215143b1e3b3eb6add7a78d/sources.list

Problem solved.

New Linux VM experience via “Quick Create” on Windows 10

I’ve never been a fan of the Windows subsystem for Linux, largely because it brings limitations and unpredictability to my Linux experience, leaving me frustrated. I prefer a full Linux VM, and a recent build of Windows 10 brings this Quick Create experience in Hyper-V for Ubuntu 18.04. (I believe this showed up in October, but I am on Windows 10 build 182298). What I like most about this build is that Xrdp is pre-installed, so you can remote into the VM and get a full screen and multi-monitor Linux experience (read below) right out of the gate.

To create your Ubuntu VM…

In Hyper-V Manage, right click your VM name and select Quick Create.

Ubuntu1

The Create Virtual Machine wizard then downloads the Ubuntu 18.04 LTS image (~1.5GB).

Ubuntu2

Once downloaded, you’ll walk through an abbreviated configuration wizard. When the wizard asks you if you’d like to login automatically, select No. Auto-login breaks remote access via Xrdp.

To access the VM…

You can right click in Hyper-V Manager, and specify full screen. If you select “Use all of my monitors” as shown below, the display automatically extends to your 2-N monitors!

image

Login with your username and password, leaving session value at the default of ‘Xorg’.

Ubuntu3

That’s all there is to it. Get the latest build of Windows 10 and give it a try!