无法在Linux Mint 18.1上安装.NET Core

时间:2017-03-12 13:46:55

标签: linux .net-core

我正在尝试按照“Install for Ubuntu 14.04, 16.04, 16.10 & Linux Mint 17 (64 bit)”的说明在Linux Mint 18.1上安装.NET Core。我因依赖而遇到错误:

enter image description here

我仍然无法直接安装缺少的依赖项:

enter image description here

我能做些什么才能使它工作,或者Linux Mint 18.1根本不受支持?

2 个答案:

答案 0 :(得分:6)

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

sudo apt-get install dotnet-dev-1.0.1

工作于18.1

jamie@tesla ~/Downloads $ sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list'
jamie@tesla ~/Downloads $ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893
Executing: /tmp/tmp.x3h2WeSDru/gpg.1.sh --keyserver
hkp://keyserver.ubuntu.com:80
--recv-keys
417A0893
gpg: requesting key 417A0893 from hkp server keyserver.ubuntu.com
gpg: key 417A0893: public key "MS Open Tech <interop@microsoft.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
jamie@tesla ~/Downloads $ sudo apt-get update
Ign:1 http://www.mirrorservice.org/sites/packages.linuxmint.com/packages serena InRelease
Hit:2 http://www.mirrorservice.org/sites/packages.linuxmint.com/packages serena Release
Get:4 https://apt-mo.trafficmanager.net/repos/dotnet-release xenial InRelease [2,835 B]
Get:5 https://apt-mo.trafficmanager.net/repos/dotnet-release xenial/main amd64 Packages [5,741 B]
Hit:6 http://archive.canonical.com/ubuntu xenial InRelease
Hit:7 http://archive.ubuntu.com/ubuntu xenial InRelease                                                                                                                           
Get:8 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]                                                                                                          
Get:9 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]                                                                                                        
Get:10 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]                                                                                                       
Fetched 315 kB in 15s (20.2 kB/s)                                                                                                                                                 
Reading package lists... Done
jamie@tesla ~/Downloads $ sudo apt-get install dotnet-dev-1.0.1
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  dotnet-host dotnet-hostfxr-1.0.1 dotnet-hostfxr-1.1.0 dotnet-sharedframework-microsoft.netcore.app-1.0.4 dotnet-sharedframework-microsoft.netcore.app-1.1.1 libcurl3
  liblldb-3.6 libllvm3.6v5 liblttng-ust-ctl2 liblttng-ust0 liburcu4
The following NEW packages will be installed
  dotnet-dev-1.0.1 dotnet-host dotnet-hostfxr-1.0.1 dotnet-hostfxr-1.1.0 dotnet-sharedframework-microsoft.netcore.app-1.0.4 dotnet-sharedframework-microsoft.netcore.app-1.1.1
  libcurl3 liblldb-3.6 libllvm3.6v5 liblttng-ust-ctl2 liblttng-ust0 liburcu4
0 to upgrade, 12 to newly install, 0 to remove and 0 not to upgrade.
Need to get 113 MB of archives.
After this operation, 342 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libcurl3 amd64 7.47.0-1ubuntu2.2 [186 kB]
Get:2 http://archive.ubuntu.com/ubuntu xenial/main amd64 libllvm3.6v5 amd64 1:3.6.2-3ubuntu2 [8,075 kB]
Get:3 https://apt-mo.trafficmanager.net/repos/dotnet-release xenial/main amd64 dotnet-host amd64 1.1.0-preview1-001100-00-1 [33.7 kB]
Get:4 https://apt-mo.trafficmanager.net/repos/dotnet-release xenial/main amd64 dotnet-hostfxr-1.0.1 amd64 1.0.1-1 [123 kB]
Get:5 https://apt-mo.trafficmanager.net/repos/dotnet-release xenial/main amd64 dotnet-sharedframework-microsoft.netcore.app-1.0.4 amd64 1.0.4-1 [22.6 MB]
Get:6 http://archive.ubuntu.com/ubuntu xenial/main amd64 liblldb-3.6 amd64 1:3.6.2-3ubuntu2 [7,303 kB]               
Get:7 http://archive.ubuntu.com/ubuntu xenial/universe amd64 liburcu4 amd64 0.9.1-3 [47.3 kB]                        
Get:8 http://archive.ubuntu.com/ubuntu xenial/universe amd64 liblttng-ust-ctl2 amd64 2.7.1-1 [72.2 kB]          
Get:9 http://archive.ubuntu.com/ubuntu xenial/universe amd64 liblttng-ust0 amd64 2.7.1-1 [127 kB]                       
Get:10 https://apt-mo.trafficmanager.net/repos/dotnet-release xenial/main amd64 dotnet-hostfxr-1.1.0 amd64 1.1.0-1 [124 kB]
Get:11 https://apt-mo.trafficmanager.net/repos/dotnet-release xenial/main amd64 dotnet-sharedframework-microsoft.netcore.app-1.1.1 amd64 1.1.1-1 [22.9 MB]
Get:12 https://apt-mo.trafficmanager.net/repos/dotnet-release xenial/main amd64 dotnet-dev-1.0.1 amd64 1.0.1-1 [51.4 MB]                                                          
Fetched 113 MB in 13s (8,498 kB/s)                                                                                                                                                
Selecting previously unselected package libcurl3:amd64.
(Reading database ... 256441 files and directories currently installed.)
Preparing to unpack .../libcurl3_7.47.0-1ubuntu2.2_amd64.deb ...
Unpacking libcurl3:amd64 (7.47.0-1ubuntu2.2) ...
Selecting previously unselected package libllvm3.6v5:amd64.
Preparing to unpack .../libllvm3.6v5_1%3a3.6.2-3ubuntu2_amd64.deb ...
Unpacking libllvm3.6v5:amd64 (1:3.6.2-3ubuntu2) ...
Selecting previously unselected package liblldb-3.6.
Preparing to unpack .../liblldb-3.6_1%3a3.6.2-3ubuntu2_amd64.deb ...
Unpacking liblldb-3.6 (1:3.6.2-3ubuntu2) ...
Selecting previously unselected package liburcu4:amd64.
Preparing to unpack .../liburcu4_0.9.1-3_amd64.deb ...
Unpacking liburcu4:amd64 (0.9.1-3) ...
Selecting previously unselected package liblttng-ust-ctl2:amd64.
Preparing to unpack .../liblttng-ust-ctl2_2.7.1-1_amd64.deb ...
Unpacking liblttng-ust-ctl2:amd64 (2.7.1-1) ...
Selecting previously unselected package liblttng-ust0:amd64.
Preparing to unpack .../liblttng-ust0_2.7.1-1_amd64.deb ...
Unpacking liblttng-ust0:amd64 (2.7.1-1) ...
Selecting previously unselected package dotnet-host.
Preparing to unpack .../dotnet-host_1.1.0-preview1-001100-00-1_amd64.deb ...
Unpacking dotnet-host (1.1.0-preview1-001100-00-1) ...
Selecting previously unselected package dotnet-hostfxr-1.0.1.
Preparing to unpack .../dotnet-hostfxr-1.0.1_1.0.1-1_amd64.deb ...
Unpacking dotnet-hostfxr-1.0.1 (1.0.1-1) ...
Selecting previously unselected package dotnet-sharedframework-microsoft.netcore.app-1.0.4.
Preparing to unpack .../dotnet-sharedframework-microsoft.netcore.app-1.0.4_1.0.4-1_amd64.deb ...
Unpacking dotnet-sharedframework-microsoft.netcore.app-1.0.4 (1.0.4-1) ...
Selecting previously unselected package dotnet-hostfxr-1.1.0.
Preparing to unpack .../dotnet-hostfxr-1.1.0_1.1.0-1_amd64.deb ...
Unpacking dotnet-hostfxr-1.1.0 (1.1.0-1) ...
Selecting previously unselected package dotnet-sharedframework-microsoft.netcore.app-1.1.1.
Preparing to unpack .../dotnet-sharedframework-microsoft.netcore.app-1.1.1_1.1.1-1_amd64.deb ...
Unpacking dotnet-sharedframework-microsoft.netcore.app-1.1.1 (1.1.1-1) ...
Selecting previously unselected package dotnet-dev-1.0.1.
Preparing to unpack .../dotnet-dev-1.0.1_1.0.1-1_amd64.deb ...
Unpacking dotnet-dev-1.0.1 (1.0.1-1) ...
Processing triggers for libc-bin (2.23-0ubuntu7) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up libcurl3:amd64 (7.47.0-1ubuntu2.2) ...
Setting up libllvm3.6v5:amd64 (1:3.6.2-3ubuntu2) ...
Setting up liblldb-3.6 (1:3.6.2-3ubuntu2) ...
Setting up liburcu4:amd64 (0.9.1-3) ...
Setting up liblttng-ust-ctl2:amd64 (2.7.1-1) ...
Setting up liblttng-ust0:amd64 (2.7.1-1) ...
Setting up dotnet-host (1.1.0-preview1-001100-00-1) ...
Setting up dotnet-hostfxr-1.0.1 (1.0.1-1) ...
Setting up dotnet-sharedframework-microsoft.netcore.app-1.0.4 (1.0.4-1) ...
Setting up dotnet-hostfxr-1.1.0 (1.1.0-1) ...
Setting up dotnet-sharedframework-microsoft.netcore.app-1.1.1 (1.1.1-1) ...
Setting up dotnet-dev-1.0.1 (1.0.1-1) ...
Processing triggers for libc-bin (2.23-0ubuntu7) ...
jamie@tesla ~/Downloads $ dotnet

Microsoft .NET Core Shared Framework Host

  Version  : 1.1.0
  Build    : 928f77c4bc3f49d892459992fb6e1d5542cb5e86

Usage: dotnet [common-options] [[options] path-to-application]

Common Options:
  --help                           Display .NET Core Shared Framework Host help.
  --version                        Display .NET Core Shared Framework Host version.

Options:
  --fx-version <version>           Version of the installed Shared Framework to use to run the application.
  --additionalprobingpath <path>   Path containing probing policy and assemblies to probe for.

Path to Application:
  The path to a .NET Core managed application, dll or exe file to execute.

If you are debugging the Shared Framework Host, set 'COREHOST_TRACE' to '1' in your environment.

To get started on developing applications for .NET Core, install the SDK from:
  http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409

答案 1 :(得分:3)

它对我有用:

$ 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-xenial-prod xenial main" > /etc/apt/sources.list.d/dotnetdev.list'
$ sudo apt-get update
$ sudo apt-get install dotnet-sdk-2.1.4

请参阅instructions

2018-05-01更新: Microsoft更改了说明,请参阅:Install .NET Core SDK 2.1.300-preview2 on Linux Ubuntu 17.10