在 ubuntu 中安装 dotnet core 最终会出现依赖冲突

Rik*_*iki 4 ubuntu apt .net-core

我之前确实在 ubuntu 中安装了 dotnetcore,没有任何问题。但有时我最终会在早期版本中遇到依赖问题,但总是使用 ubuntu 20.04。

我正在遵循此处提供的指导

每当我尝试安装sudo apt-get install dotnet-sdk-3.1它时都会显示依赖性问题:

以下软件包具有未满足的依赖项:

dotnet-sdk-3.1 : 取决于: dotnet-runtime-3.1 (>= 3.1.3) 但它不会被安装

取决于:aspnetcore-runtime-3.1 (>= 3.1.3) 但它不会被安装

E:无法纠正问题,您持有破损的包裹。

我试图一个一个地添加每个包,最终sudo apt install dotnet-sdk-3.1 dotnet-runtime-3.1 aspnetcore-runtime-3.1 dotnet-runtime-deps-3.1.

The following packages have unmet dependencies:
 dotnet-runtime-deps-3.1 : Depends: libicu but it is not installable or
                                    libicu63 but it is not installable or
                                    libicu60 but it is not installable or
                                    libicu57 but it is not installable or
                                    libicu55 but it is not installable or
                                    libicu52 but it is not installable
Run Code Online (Sandbox Code Playgroud)

现在apt-cache policy libicu(或任何 libicu63 等)显示没有安装候选。

libicu:
已安装:(无)
候选:(无)
版本表:

我不确定为什么会发生这种情况以及如何解决它。

nZe*_*eus 7

这里正在讨论 - https://github.com/dotnet/core/issues/4616(这是https://github.com/dotnet/core/issues/4360的副本)

您可以执行以下解决方法:

脚步:

$ wget http://ftp.us.debian.org/debian/pool/main/i/icu/libicu57_57.1-6+deb9u4_amd64.deb
$ sudo dpkg -i libicu57_57.1-6+deb9u4_amd64.deb
$ sudo apt install dotnet-sdk-3.1

$ dotnet --version
3.1.201
Run Code Online (Sandbox Code Playgroud)

为我工作