我在我的 Debian Jessie Box 上安装 Dotnet Core SDK 时遇到问题。这是我遵循的指南https://docs.microsoft.com/en-us/dotnet/core/linux-prerequisites?tabs=netcore2x。
注册产品密钥和提要后,我得到的只是Unable to locate Package
尝试执行apt-get install dotnet-sdk-2.0.0
or时dotnet-sdk-2.0.2
。我目前以 root 身份登录,因为这是我的本地开发机器。
重现步骤:
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-jessie-prod jessie main" > /etc/apt/sources.list.d/dotnetdev.list'
apt-get update
apt-get install dotnet-sdk-2.0.0
Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package dotnet-sdk-2.0.0 E: Couldn't find any package by regex 'dotnet-sdk-2.0.0'
我哪里错了?就像 apt 由于某种原因看不到微软的 repo。
我意识到我可以从下载的 tarball 中安装它,如有必要我会这样做,但我更喜欢使用包管理器以便于维护。
这是 apt-get update 的输出
root@myserver:/etc/apt# apt-get update Hit https://deb.nodesource.com jessie InRelease Hit https://deb.nodesource.com jessie/main Sources Hit https://deb.nodesource.com jessie/main i386 Packages Get:1 https://packages.microsoft.com jessie InRelease [2,846 B] Get:2 https://deb.nodesource.com jessie/main Translation-en_US [162 B] Get:3 https://deb.nodesource.com jessie/main Translation-en [162 B] Get:4 https://packages.microsoft.com jessie/main amd64 Packages [6,069 B] Get:5 https://deb.nodesource.com jessie/main Translation-en_US [162 B] Get:6 https://packages.microsoft.com jessie/main Translation-en_US [178 B] Get:7 https://deb.nodesource.com jessie/main Translation-en [162 B] Get:8 https://deb.nodesource.com jessie/main Translation-en_US [162 B] Get:9 https://packages.microsoft.com jessie/main Translation-en [178 B] Get:10 https://deb.nodesource.com jessie/main Translation-en [162 B] Get:11 https://packages.microsoft.com jessie/main Translation-en_US [178 B] Get:12 https://deb.nodesource.com jessie/main Translation-en_US [162 B] Get:13 https://packages.microsoft.com jessie/main Translation-en [178 B] Get:14 https://deb.nodesource.com jessie/main Translation-en [162 B] Get:15 https://packages.microsoft.com jessie/main Translation-en_US [178 B] Get:16 https://deb.nodesource.com jessie/main Translation-en_US [162 B] Ign https://deb.nodesource.com jessie/main Translation-en_US Get:17 https://packages.microsoft.com jessie/main Translation-en [178 B] Get:18 https://deb.nodesource.com jessie/main Translation-en [162 B] Ign https://deb.nodesource.com jessie/main Translation-en Get:19 https://packages.microsoft.com jessie/main Translation-en_US [178 B] Get:20 https://packages.microsoft.com jessie/main Translation-en [178 B] Get:21 https://packages.microsoft.com jessie/main Translation-en_US [178 B] Ign https://packages.microsoft.com jessie/main Translation-en_US Get:22 https://packages.microsoft.com jessie/main Translation-en [178 B] Ign https://packages.microsoft.com jessie/main Translation-en Fetched 8,915 B in 1s (5,969 B/s) Reading package lists... Done