一、先添加微软包存储库
rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
二、在有网的情况下把离线包下载到电脑上(只安装sdk即可,libgdiplus验证码使用)
yum install --downloadonly --downloaddir=/home/joint/soft/dotnet-sdk-3.1 dotnet-sdk-3.1
yum install --downloadonly --downloaddir=/home/joint/soft/aspnetcore-runtime-3.1 aspnetcore-runtime-3.1
yum install --downloadonly --downloaddir=/home/joint/soft/dotnet-runtime-3.1 dotnet-runtime-3.1
dnf install https://extras.getpagespeed.com/release-el8-latest.rpm
yum install --downloadonly --downloaddir=/home/joint/soft/libgdiplus libgdiplus
三、然后把离线包拷贝到无网的电脑上,进行安装。首先切换到aspnetcore-runtime-3.1文件夹下,安装指令
rpm -ivh *.rpm
四、切换到dotnet-runtime-3.1文件夹下,安装指令
rpm -ivh *.rpm