3

我在我的 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.0or时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
4

2 回答 2

3

经过几天的斗争,我决定将我的盒子升级到 Debian Stretch。这是我关注的文章https://linuxconfig.org/how-to-upgrade-debian-8-jessie-to-debian-9-stretch

apt-get 更新
apt-get 升级
apt-get dist-upgrade

改变了我的sources.list

FROM JESSIE  
deb http://httpredir.debian.org/debian jessie main  
deb http://httpredir.debian.org/debian jessie-updates main  
deb http://security.debian.org jessie/updates main  
TO STRETCH  
deb http://httpredir.debian.org/debian stretch main  
deb http://httpredir.debian.org/debian stretch-updates main  
deb http://security.debian.org stretch/updates main  

再跑一次

apt-get 更新
apt-get 升级
apt-get dist-upgrade

升级完成后,我终于可以看到我正在寻找的 dotnet 核心包了!

于 2017-11-29T04:27:19.160 回答
0

这可能对您不起作用的另一个原因是,如果您运行的是 32 位版本的 linux。点网核心包仅适用于 64 位。当尝试在 32 位版本的 Debian 上安装时,我也遇到了这个问题。 https://docs.microsoft.com/en-us/dotnet/core/linux-prerequisites?tabs=netcore2x

于 2019-01-11T01:07:35.340 回答