Linux CentOS 7 離線安裝.NET環境

下載

下載.NET
例如:
aspnetcore-runtime-6.0.15-linux-x64.tar.gz

複製

複製到如下目錄:
/usr/local/dotnet/aspnetcore-runtime-6.0.15-linux-x64.tar.gz

解壓

cd /usr/local/dotnet/
tar -zxvf aspnetcore-runtime-6.0.15-linux-x64.tar.gz

創建軟鏈接

相當於windows下的快捷方式
ln -s /usr/local/dotnet/dotnet /bin

編輯 /etc/profile 文件

vim /etc/profile
添加如下內容:
export PATH=$PATH:/usr/local/dotnet
export DOTNET_ROOT=/usr/local/dotnet
使立即生效:
source /etc/profile

驗證是否安裝成功

在任意目錄輸入以下命令:
dotnet --info
如圖:

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章