How to install .Net 6 on Linux Arm?
By Tri Nguyen onIntro
In this post I would like to document how I install .Net 6 on Linux Arm64 manually. For detailed instructions, you can read on Microsoft Docs.
Steps
- Go to download site of .Net 6. Download the version for your server to local server. In my case I downloaded the Arm64 version and save the file as dni.tar.gz.
curl https://download.visualstudio.microsoft.com/download/pr/d30e9e2e-10a5-46c6-9b81-1a6a965d6739/6f56a3893b16fa841c8cb34ec9b3768d/aspnetcore-runtime-6.0.2-linux-arm64.tar.gz --output dni.tar.gz
- Create /usr/share/dotnet
mkdir -p /usr/share/dotnet
- Extract dni.tar.gz (downloaded from Microsoft) to /usr/share/dotnet.
tar zxf dni.tar.gz -C /usr/share/dotnet/
- Create a symbolic link to /usr/bin/dotnet
ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
- Test if dotnet command can be found
dotnet --info
- Sample config for using supervisor to restart application
sudo apt-get install supervisor
sudo nano /etc/supervisor/conf.d/{domain}.conf
[program:APP_NAME]
command=/usr/bin/dotnet API_DLL_PATH --urls http://0.0.0.0:API_PORT
directory=API_DIR_PATH
autostart=true
autorestart=true
stderr_logfile=/var/log/API_DOMAIN.err.log
stdout_logfile=/var/log/API_DOMAIN.out.log
environment=ASPNETCORE_ENVIRONMENT=Production
user=www-data
stopsignal=INT
Restart supervisor
sudo service supervisor restart
sudo tail -f /var/log/supervisor/supervisord.log
or
supervisorctl restart canduyentiendinh
Comments
If you have any question, you can start a new discussion.