在Ubuntu 16.04上出现此错误,无法找到包dotnet-dev-1.0.0-preview2

时间:2022-05-23 11:45:48

I followed the instruction from this link.

我按照这个链接的说明进行操作。

$ sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list'
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893
$ sudo apt-get update

Then while I run this command:

然后在我运行此命令时:

$ sudo apt-get install dotnet-dev-1.0.0-preview2.1-003177

I get the following error:

我收到以下错误:

E: Unable to locate package dotnet-dev-1.0.0-preview2.1-003177

E:无法找到包dotnet-dev-1.0.0-preview2.1-003177

E: Couldn't find any package by regex 'dotnet-dev-1.0.0-preview2.1-003177'

E:找不到正则表达式'dotnet-dev-1.0.0-preview2.1-003177'的任何软件包

Please help!

请帮忙!

3 个解决方案

#1


3  

I just checked the repository pool and found they have changed their naming convention. In your above command the package name has been entered incorrectly:

我刚检查了存储库池,发现他们已经更改了命名约定。在上面的命令中,包名称输入错误:

dotnet-dev-1.0.0-preview2.1-003177

DOTNET-DEV-1.0.0-preview2.1-003177

Where it should be:

它应该在哪里:

dotnet-dev-1.0.0-preview2-1-003177

DOTNET-DEV-1.0.0-preview2-1-003177

Notice the - instead of the .. If this is the issue then it is either a mistyped tutorial on the Microsoft site or a change in their naming scheme that hasn't been reflected everywhere.

请注意 - 而不是..如果这是问题,那么它是微软网站上的错误教程或其命名方案的变化,并未在任何地方反映出来。

#2


2  

You need to install HTTPS transport layer security for the apt-get application. The .NET Core repos are https, that is why they are not updated along with the other packages.

您需要为apt-get应用程序安装HTTPS传输层安全性。 .NET Core repos是https,这就是为什么它们不与其他软件包一起更新的原因。

Simply type in the terminal

只需输入终端即可

sudo apt-get install apt-transport-https

and your

和你的

sudo apt-get install dotnet-dev-1.0.0-preview2.1-003177

should work like a charm! (at least it did for me)

应该像魅力一样工作! (至少它对我有用)

I'd leave this in a comment, or upvote the other comment that mentioned this fix, but because I am new I am not allowed to do any of those things. I just wanted to confirm that that fix worked for me.

我会在评论中留下这个,或者赞成提到这个修复的其他评论,但因为我是新的,我不被允许做任何这些事情。我只是想确认那个修复对我有用。

#3


1  

make sure you don't get any errors while updating the package list. I had to install apt-transport-https before executing sudo apt-get update.

确保在更新包列表时不会出现任何错误。我必须在执行sudo apt-get update之前安装apt-transport-https。

#1


3  

I just checked the repository pool and found they have changed their naming convention. In your above command the package name has been entered incorrectly:

我刚检查了存储库池,发现他们已经更改了命名约定。在上面的命令中,包名称输入错误:

dotnet-dev-1.0.0-preview2.1-003177

DOTNET-DEV-1.0.0-preview2.1-003177

Where it should be:

它应该在哪里:

dotnet-dev-1.0.0-preview2-1-003177

DOTNET-DEV-1.0.0-preview2-1-003177

Notice the - instead of the .. If this is the issue then it is either a mistyped tutorial on the Microsoft site or a change in their naming scheme that hasn't been reflected everywhere.

请注意 - 而不是..如果这是问题,那么它是微软网站上的错误教程或其命名方案的变化,并未在任何地方反映出来。

#2


2  

You need to install HTTPS transport layer security for the apt-get application. The .NET Core repos are https, that is why they are not updated along with the other packages.

您需要为apt-get应用程序安装HTTPS传输层安全性。 .NET Core repos是https,这就是为什么它们不与其他软件包一起更新的原因。

Simply type in the terminal

只需输入终端即可

sudo apt-get install apt-transport-https

and your

和你的

sudo apt-get install dotnet-dev-1.0.0-preview2.1-003177

should work like a charm! (at least it did for me)

应该像魅力一样工作! (至少它对我有用)

I'd leave this in a comment, or upvote the other comment that mentioned this fix, but because I am new I am not allowed to do any of those things. I just wanted to confirm that that fix worked for me.

我会在评论中留下这个,或者赞成提到这个修复的其他评论,但因为我是新的,我不被允许做任何这些事情。我只是想确认那个修复对我有用。

#3


1  

make sure you don't get any errors while updating the package list. I had to install apt-transport-https before executing sudo apt-get update.

确保在更新包列表时不会出现任何错误。我必须在执行sudo apt-get update之前安装apt-transport-https。