【问题标题】:Cannot install .Net Core 2.2 on UBuntu 18.04无法在 UBuntu 18.04 上安装 .Net Core 2.2
【发布时间】:2019-06-01 14:47:47
【问题描述】:

我试图将ASP.NET Core 2.2 应用程序部署到运行Ubuntu 18.04 的DigitalOcean droplet。我按照official documentation 上提供的步骤操作。

但我得到了错误。

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 dotnet-sdk-2.2 : Depends: aspnetcore-runtime-2.2 (>= 2.2.0) but it is not going to be installed
                  Depends: dotnet-runtime-2.2 (>= 2.2.0) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

  

有什么帮助吗?我试图从其他论坛获得帮助,所以答案仍然没有运气。

【问题讨论】:

    标签: ubuntu .net-core asp.net-core-2.0 ubuntu-18.04


    【解决方案1】:

    这是GitHub 上的一个已知问题

    据我所知,开发人员提出了不同的解决方案。我建议你检查链接。

    问题一般是因为缺少libicu。 libicu的版本在哪里。

    以下是DotNet-Core Sdk dotnet-sdk-2.2版本的建议解决方案

    curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
    sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
    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 install apt-transport-https
    sudo apt-get update
    sudo apt-get install dotnet-sdk-2.2
     
    

    【讨论】:

    • 我按照您提供的确切步骤操作,但只更改了 2.2 版的最后一个命令:sudo apt-get install dotnet-sdk-2.2,它对我有用。您可以通过此更改更新您的答案。也许对其他人也有帮助。谢谢。
    • 我看到这个问题专门询问了 ubuntu 18.04,但我没有注意有不同的版本,并且代码对我不起作用,直到我更新了 sources.list.d 对 ubuntu 的修改释放我有。如果指出这一点会很有帮助。
    • 我在 net core 3.1 中遇到了同样的问题,它也可以工作,谢谢。
    • 这对我有用,因为我需要将 dotnet sdk 2.2 添加到 dockerfile,以支持我们的 devops 工作流程中的旧版本,感谢分享
    【解决方案2】:

    解决方案在这里Download and install libicu..

    【讨论】:

      【解决方案3】:

      我遇到了同样的问题。上面的修复并没有真正为我工作。我必须下载并安装 libicu57 和 libssl1.0.0 才能成功运行和安装 .net。

      libicu57
      libssl1.0.0

      下载.net sdk的具体版本,你的可能不一样。

      安装后,运行

      sudo apt-get install dotnet-sdk-2.2

      希望这会有所帮助。

      【讨论】:

      • 在 Linux 20.04 中,即使我无法安装 libssl1.0.0 但仅安装 libicu57 ,我也可以成功安装 dotnet-sdk-2.2。谢谢
      【解决方案4】:

      我手动复制了列表,它起作用了:

      wget -q https://packages.microsoft.com/config/ubuntu/18.04/prod.list
      sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list
      sudo apt-get update
      
      sudo apt-get install dotnet-sdk-2.2
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2020-06-07
        • 2021-08-10
        • 2020-09-09
        • 2019-01-09
        • 2019-01-17
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多