我刚刚在虚拟机上安装了 Ubuntu 16.04,并尝试安装 .Net 核心。
我已经关注以下链接在 Ubuntu 上安装 .Net Core
我尝试安装包但失败了。
这里我正在放输出,请检查一次。
$ sudo apt-get install dotnet-dev-1.0.0-preview1-002702
Reading package lists... Done
Building dependency tree
Reading state information... Done
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-dev-1.0.0-preview1-002702 : Depends: dotnet-sharedframework-microsoft.netcore.app-1.0.0-rc2-3002702 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
$ sudo apt-get install dotnet-sharedframework-microsoft.netcore.app-1.0.0-rc2-3002702
Reading package lists... Done
Building dependency tree
Reading state information... Done
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-sharedframework-microsoft.netcore.app-1.0.0-rc2-3002702 : Depends: libicu52 (>= 52~m1-1~) but it is not installable
E: Unable to correct problems, you have held broken packages.
安装 Ubuntu 16.04 后,我发现 16.04 仍然不支持 .Net core,最高支持到 15.10。
为什么在 Ubuntu 中安装 .Net core 页面上没有关于应该使用哪个版本的 Ubuntu 的说明?
Ubuntu 16.04 仍然不支持 .Net Core,这是正确的吗?有什么办法可以解决这个问题吗?
答案1
尝试安装依赖包 dotnet-sharedframework-microsoft.netcore.app 时会出现下一个错误,提示该包依赖于 libicu52 但无法安装
http://packages.ubuntu.com/pl/trusty/amd64/libicu52/download
并下载 .deb 包。现在,转到下载位置并通过运行以下命令安装该包:
sudo dpkg -i libicu52_52.1-3ubuntu0.4_amd64.deb
现在,您将能够运行以下命令:
sudo apt-get install dotnet-sharedframework-microsoft.netcore.app-1.0.0-rc2-3002702
sudo apt-get install dotnet-dev-1.0.0-preview1-002702
dotnet --version
祝你好运
来源:http://zablo.net/blog/post/run-and-debug-asp-net-core-rc2-ubuntu-16-04
答案2
你可以跑
sudo apt-get 安装 -f
自动解决一些错误。来自man apt
:
-f, --fix-broken Fix; attempt to correct a system with broken dependencies in place. This option, when used with install/remove, can omit any packages to permit APT to deduce a likely solution. If packages are specified, these have to completely correct the problem. The option is sometimes necessary when running APT for the first time; APT itself does not allow broken package dependencies to exist on a system. It is possible that a system's dependency structure can be so corrupt as to require manual intervention (which usually means using dselect(1) or dpkg --remove to eliminate some of the offending packages). Use of this option together with -m may produce an error in some situations. Configuration Item: APT::Get::Fix-Broken.
它将安装缺少的软件包或依赖项。