RHEL7 安装 net6.0

下载并解压 net6.0:

wget https://download.visualstudio.microsoft.com/download/pr/99f90118-96b4-4d06-97ad-d779715319f6/aecf393f9b9d362b66b93a47d90cfa8d/aspnetcore-runtime-6.0.32-linux-x64.tar.gz

#tar -zxvf aspnetcore-runtime-6.0.32-linux-x64.tar.gz
mkdir /home/aspnetcore-runtime-6.0.32-linux-x64
tar -zxf aspnetcore-runtime-6.0.32-linux-x64.tar.gz -C /home/aspnetcore-runtime-6.0.32-linux-x64

设置 net6.0 环境变量:

1、vim /etc/profile,增加以下内容:

export DOTNET_ROOT=/home/aspnetcore-runtime-6.0.32-linux-x64
export PATH=$PATH:$DOTNET_ROOT

2、生效环境变量:

source /etc/profile

3、查看环境变量:

env|grep PATH

4、查看安装信息:

dotnet --info

运行 net core 程序:

cd /home/Web/
nohup dotnet KSoft.Web.dll &