Centos下安裝 .net Core運行程序

首先要進行更新下鏡像文件bash

sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[packages-microsoft-com-prod]\nname=packages-microsoft-com-prod \nbaseurl= https://packages.microsoft.com/yumrepos/microsoft-rhel7.3-prod\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/dotnetdev.repo'

[root@localhost /]# rpm --import https://packages.microsoft.com/keys/microsoft.asc
[root@localhost /]# sh -c 'echo -e "[packages-microsoft-com-prod]\nname=packages-microsoft-com-prod \nbaseurl= https://packages.microsoft.com/yumrepos/microsoft-rhel7.3-prod\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/dotnetdev.repo'測試

 

 

 接着就能夠直接安裝了ui

Install the .NET SDK

Update the products available for installation, install the components required by .NET, then install the .NET SDK.url

In your command prompt, run the following commands:rest

 

sudo yum update
sudo yum install libunwind libicu
sudo yum install dotnet-sdk-2.1.103

  

A command will be run during the install process that will improve project restore speed and enable offline access. It will take up to a minute to complete.
驗證中 : aspnetcore-store-2.0.6-2.0.6-1.x86_64 1/8
驗證中 : dotnet-runtime-2.0.6-2.0.6-1.x86_64 2/8
驗證中 : dotnet-hostfxr-2.0.6-2.0.6-1.x86_64 3/8
驗證中 : aspnetcore-store-2.0.5-2.0.5-1.x86_64 4/8
驗證中 : aspnetcore-store-2.0.3-2.0.3-1.x86_64 5/8
驗證中 : dotnet-sdk-2.1.103-2.1.103-1.x86_64 6/8
驗證中 : dotnet-host-2.1.0_preview1_26216_03-1.x86_64 7/8
驗證中 : aspnetcore-store-2.0.0-2.0.0-1.x86_64 8/8 component

已安裝:
dotnet-sdk-2.1.103.x86_64 0:2.1.103-1 blog

做爲依賴被安裝:
aspnetcore-store-2.0.0.x86_64 0:2.0.0-1 aspnetcore-store-2.0.3.x86_64 0:2.0.3-1 aspnetcore-store-2.0.5.x86_64 0:2.0.5-1 aspnetcore-store-2.0.6.x86_64 0:2.0.6-1
dotnet-host.x86_64 0:2.1.0_preview1_26216_03-1 dotnet-hostfxr-2.0.6.x86_64 0:2.0.6-1 dotnet-runtime-2.0.6.x86_64 0:2.0.6-1 io

 

好了,如今你能夠運行donet命令進行測試了,默認安裝目錄在/usr/share/dotnet下面class

 

dotnet --version#查看版本
dotnet --info #查看安裝的信息
dotnet new razor #能夠建立一個razorPage項目,
相關文章
相關標籤/搜索