在 Ubuntu 20.04 上安装 ASP.net

在 Ubuntu 20.04 上安装 ASP.net

我正在尝试将 ASP.net 添加到我的 Ununtu 20.04 服务器上。按照:

https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu

他们告诉你:

wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb

一切都很好,除了它给出 404!

Resolving packages.microsoft.com (packages.microsoft.com)... 13.81.215.193
Connecting to packages.microsoft.com (packages.microsoft.com)|13.81.215.193|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2021-06-17 06:04:56 ERROR 404: Not Found.

还有其他方法吗?我搜索了一番,但找不到任何关于密钥为 404 的信息。谢谢!

恕我直言,这确实很奇怪!如果你查看 M$ 的网站:

https://packages.microsoft.com/config/ubuntu/20.04/

您可以看到该文件 - 但是当您单击它时,果然出现了 404:

https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb

更新:我找到了这个页面:

https://docs.microsoft.com/en-us/windows-server/administration/linux-package-repository-for-microsoft-software

这使得部分功能得以实现 - 但我现在得到:

root@south:/home/ebay# apt-get install dotnet-sdk-3.1
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libauparse0 libc-ares2 nodejs-doc
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  aspnetcore-runtime-3.1 aspnetcore-targeting-pack-3.1 dotnet-apphost-pack-3.1 dotnet-host dotnet-hostfxr-3.1 dotnet-runtime-3.1 dotnet-runtime-deps-3.1 dotnet-targeting-pack-3.1 netstandard-targeting-pack-2.1
The following NEW packages will be installed:
  aspnetcore-runtime-3.1 aspnetcore-targeting-pack-3.1 dotnet-apphost-pack-3.1 dotnet-host dotnet-hostfxr-3.1 dotnet-runtime-3.1 dotnet-runtime-deps-3.1 dotnet-sdk-3.1 dotnet-targeting-pack-3.1 netstandard-targeting-pack-2.1
0 upgraded, 10 newly installed, 0 to remove and 340 not upgraded.
Need to get 80.4 MB of archives.
After this operation, 342 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Err:1 https://packages.microsoft.com/ubuntu/20.04/prod focal/main amd64 dotnet-host amd64 5.0.7-1
  404  Not Found [IP: 13.80.99.124 443]
Err:2 https://packages.microsoft.com/ubuntu/20.04/prod focal/main amd64 dotnet-hostfxr-3.1 amd64 3.1.16-1
  404  Not Found [IP: 13.80.99.124 443]
Err:3 https://packages.microsoft.com/ubuntu/20.04/prod focal/main amd64 dotnet-runtime-deps-3.1 amd64 3.1.16-1
  404  Not Found [IP: 13.80.99.124 443]
Err:4 https://packages.microsoft.com/ubuntu/20.04/prod focal/main amd64 dotnet-runtime-3.1 amd64 3.1.16-1
  404  Not Found [IP: 13.80.99.124 443]
Err:5 https://packages.microsoft.com/ubuntu/20.04/prod focal/main amd64 aspnetcore-runtime-3.1 amd64 3.1.16-1
  404  Not Found [IP: 13.80.99.124 443]
Err:6 https://packages.microsoft.com/ubuntu/20.04/prod focal/main amd64 dotnet-targeting-pack-3.1 amd64 3.1.0-1
  404  Not Found [IP: 13.80.99.124 443]
Err:7 https://packages.microsoft.com/ubuntu/20.04/prod focal/main amd64 aspnetcore-targeting-pack-3.1 amd64 3.1.10-1
  404  Not Found [IP: 13.80.99.124 443]
Err:8 https://packages.microsoft.com/ubuntu/20.04/prod focal/main amd64 dotnet-apphost-pack-3.1 amd64 3.1.16-1
  404  Not Found [IP: 13.80.99.124 443]
Err:9 https://packages.microsoft.com/ubuntu/20.04/prod focal/main amd64 netstandard-targeting-pack-2.1 amd64 2.1.0-1
  404  Not Found [IP: 13.80.99.124 443]
Err:10 https://packages.microsoft.com/ubuntu/20.04/prod focal/main amd64 dotnet-sdk-3.1 amd64 3.1.410-1
  404  Not Found [IP: 13.80.99.124 443]
E: Failed to fetch https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/d/dotnet-host/dotnet-host-5.0.7-x64.deb  404  Not Found [IP: 13.80.99.124 443]
E: Failed to fetch https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/d/dotnet-hostfxr-3.1/dotnet-hostfxr-3.1.16-x64.deb  404  Not Found [IP: 13.80.99.124 443]
E: Failed to fetch https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/d/dotnet-runtime-deps-3.1/dotnet-runtime-deps-3.1.16-x64.deb  404  Not Found [IP: 13.80.99.124 443]
E: Failed to fetch https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/d/dotnet-runtime-3.1/dotnet-runtime-3.1.16-x64.deb  404  Not Found [IP: 13.80.99.124 443]
E: Failed to fetch https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/a/aspnetcore-runtime-3.1/aspnetcore-runtime-3.1.16-x64.deb  404  Not Found [IP: 13.80.99.124 443]
E: Failed to fetch https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/d/dotnet-targeting-pack-3.1/dotnet-targeting-pack-3.1.0-x64.deb  404  Not Found [IP: 13.80.99.124 443]
E: Failed to fetch https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/a/aspnetcore-targeting-pack-3.1/aspnetcore-targeting-pack-3.1.10.deb  404  Not Found [IP: 13.80.99.124 443]
E: Failed to fetch https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/d/dotnet-apphost-pack-3.1/dotnet-apphost-pack-3.1.16-x64.deb  404  Not Found [IP: 13.80.99.124 443]
E: Failed to fetch https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/n/netstandard-targeting-pack-2.1/netstandard-targeting-pack-2.1_2.1.0-1_amd64.deb  404  Not Found [IP: 13.80.99.124 443]
E: Failed to fetch https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/d/dotnet-sdk-3.1/dotnet-sdk-3.1.410-x64.deb  404  Not Found [IP: 13.80.99.124 443]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

更新:M$ 已经修复了他们的 repo,现在让我可以安装!

答案1

微软现在已经解决了这个问题。这是他们那边的问题(很多非常恼火的开发人员一直在追着他们)

相关内容