[DotNetCore] Azure Linux VM 18.04 安裝 dotnet core 出現 E: Unable to locate package dotnet-sdk-2.2

2019-04-12

官方網站其實教學在 Linux 上面 的文件非常的完整和簡單 教學文件在這 https://dotnet.microsoft.com/download/linux-package-manager/ubuntu18-04/sdk-current#ubuntu18-04-issue

但是我一直都會遇到一個錯誤 就是

E: Unable to locate package dotnet-sdk-2.2
E: Couldn't find any package by glob 'dotnet-sdk-2.2'
E: Couldn't find any package by regex 'dotnet-sdk-2.2


這時候官方文件就無法完成安裝,之後我上網找一下,最後我是用這方法解決問題的

sudo apt-key adv --keyserver packages.microsoft.com --recv-keys EB3E94ADBE1229CF
sudo apt-key adv --keyserver packages.microsoft.com --recv-keys 52E16F86FEE04B979B07E28DB02C46DF417A0893
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-bionic-prod bionic main" > /etc/apt/sources.list.d/dotnetdev.list
sudo apt-get update
sudo apt-get install apt-transport-https

sudo apt-get install aspnetcore-runtime-2.2
sudo apt-get update

sudo apt-get install dotnet-sdk-2.2

這邊筆記一下,怕有一天會用到

這邊是資料來源:  https://github.com/dotnet/core/issues/1889


當麻許的超技八 2014 | Donma Hsu Design.