linux上安装.net 5.0
一、CentOS8.2在线安装.net 5.0 直接执行命令:sudo dnf install dotnet-sdk-5.0
二、centos7.6 在线安装.net 5.0
首先,配置仓库:
sudo rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
然后,执行安装命令:
sudo yum install dotnet-sdk-5.0 -y
三、CentOS8.2及CentOS7.6离线安装.net 5.0 3.1 准备离线安装包 安装包的下载地址:https://dotnet.microsoft.com/download/dotnet/5.0
3.2 安装依赖项:
yum install krb5-libs libicu openssl-libs zlib -y
3.3 安装.net 5
将net5的安装包上传到/usr/local/
目录下,然后在这个目录下创建文件夹dotnet
,最后将net5的安装包解压到这个dotnet
目录下:
mkdir dotnet
tar -zxvf dotnet-sdk-5.0.203-linux-x64.tar.gz -C dotnet
将dotnet添加到环境变量中:
export DOTNET_ROOT=/usr/local/dotnet
export PATH=$DOTNET_ROOT:$PATH
刷新环境变量:
source /etc/profile
来源:https://blog.csdn.net/u010476739/article/details/116710199