• 微信公众号:美女很有趣。 工作之余,放松一下,关注即送10G+美女照片!

CentOS 安装 NET Core SDK 

开发技术 开发技术 4小时前 2次浏览

CentOS 安装 NET Core SDK 
注册 Microsoft 密钥和源
sudo rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
安装 .NET Core SDK
sudo yum install dotnet-sdk-3.1
安装过程中如提示需要安装依赖的话执行:
sudo yum install libunwind libicu
若提示找不到安装包,说明yum源 需要升级则 更换yum源 centos更换阿里云的YUM源的方法


1、备份

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/

CentOS 5

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

CentOS 6

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

CentOS 7

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3、之后运行yum makecache生成缓存

更新完yum 后重新执行以下安装步骤即可

sudo yum install libunwind libicu

sudo yum install dotnet-sdk-3.1
安装完成后查看是否安装成功


[bob@localhost ~]$ dotnet –info
.NET Core SDK (reflecting any global.json):
Version: 2.1.509
Commit: 76b7a25db8

Runtime Environment:
OS Name: centos
OS Version: 8
OS Platform: Linux
RID: centos.8-x64
Base Path: /usr/lib64/dotnet/sdk/2.1.509/

Host (useful for support):
Version: 3.1.3
Commit: 4a9f85e9f8

.NET Core SDKs installed:
2.1.509 [/usr/lib64/dotnet/sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.3 [/usr/lib64/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.13 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.3 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download

https://www.cnblogs.com/bob-zb/p/12761733.html

声明:原创博客请在转载时保留原文链接或者在文章开头加上本人博客地址,如发现错误,欢迎批评指正。
分类: .NET Core


程序员灯塔
转载请注明原文链接:CentOS 安装 NET Core SDK 
喜欢 (0)