[Linux] - 树莓派 4B 安装 .NET Core 3.x (arm64),并设置其开机自启动


硬件:Raspberry Pi 4B
系统:Ubuntu 19.10 (Eoan Ermine) for IOT
.Net Core 官网:https://dotnet.microsoft.com/download/dotnet-core/3.1

操作步骤

1. 系统环境准备

sudo apt-get update
sudo apt-get upgrade

2. .NET Core 3.x arm64 位安装包下载

wget https://download.visualstudio.microsoft.com/download/pr/2ea7ea69-6110-4c39-a07c-bd4df663e49b/5d60f17a167a5696e63904f7a586d072/dotnet-sdk-3.1.102-linux-arm64.tar.gz
wget https://download.visualstudio.microsoft.com/download/pr/ec985ae1-e15c-4858-b586-de5f78956573/f585f8ffc303bbca6a711ecd61417a40/aspnetcore-runtime-3.1.2-linux-arm64.tar.gz

3. SDK 和 Runtime 安装包解压

mkdir dotnet-arm64
tar zxf dotnet-sdk-3.1.102-linux-arm64.tar.gz -C $HOME/dotnet-arm64
tar zxf aspnetcore-runtime-3.1.2-linux-arm64.tar.gz -C $HOME/dotnet-arm64

4. 系统环境变量设置

export DOTNET_ROOT=$HOME/dotnet-arm64
export PATH=$PATH:$HOME/dotnet-arm64

5. 这时候 .Net Core 已安装成功,可以查看信息了

dotnet --info

 

6. .NET Core 自启动设置

6.1 在 Ubuntu 系统中

sudo nano .profile

6.2 在 Raspbian / Debian 系统中

sudo nano .bashrc

添加环境变量启动项

# set .NET Core SDK and Runtime path
export DOTNET_ROOT=$HOME/dotnet-arm64
export PATH=$PATH:$HOME/dotnet-arm64

 

7. 重启系统,.NET Core 可以自启动成功。

 

参考资料

https://edi.wang/post/2019/9/29/setup-net-core-30-runtime-and-sdk-on-raspberry-pi-4
https://www.cnblogs.com/jinzesudawei/p/11701669.html
https://www.petecodes.co.uk/explorations-in-dot-net-core-3-0-for-raspberry-pi/


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM