How to Install .NET Core on Linux and macOS
Updated on January 1, 2021⚑Retro Assembler.NETLinuxThis information is outdated. See the new guide for .NET 5.0
If you want to use Retro Assembler to code on Linux (even on a Raspberry Pi) or on macOS, you have to install .NET Core on your computer. Normally you'd just go to https://dotnet.microsoft.com/download and follow the instructions, but if you need help, I'll try to provide some here.
Disclaimers
- During the time of writing this guide, the current .NET Core version is 3.1. If there is a newer version by the time you read this, install that one.
- Only the .NET Core Runtime is needed to run applications like Retro Assembler, so this guide focuses on that option.
- This guide assumes you use Ubuntu Linux 19.10, or any of the recent macOS versions on Mac.
- This guide assumes you use the Bash shell which is the default on most systems.
- If you mess up something in your system, I'm not responsible for that.
Installing on Windows
- Go to the .NET Core download page, choose Windows on the top.
- Click on Download .NET Core Runtime, then click on Download x64.
Installing on macOS
- Go to the .NET Core download page, choose macOS on the top.
- Here download the .NET Core SDK installer (recommended), or under All .NET Core downloads..., pick the latest version and from the Run apps - Runtime column download the installer you need.
Installing on Linux
- Go to the .NET Core download page, choose Linux on the top.
- Click on the Install .NET Core button and on the page it opens, select your chosen Linux distribution. Or here is a direct link to the Ubuntu 19.10 - x64 page which lists the installation steps.
Here are the commands you'll need to enter into the Terminal:
#Download the Ubuntu 19.10 related packages for the package manager. wget -q https://packages.microsoft.com/config/ubuntu/19.10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb #Install it for the package manager. sudo dpkg -i packages-microsoft-prod.deb #Install this utility. sudo apt-get install apt-transport-https #Update the package manager. sudo apt-get update #Install the .NET Core Runtime. sudo apt-get install dotnet-runtime-3.1
Installing on Raspberry Pi and on other ARM based SBCs
- Go to the .NET Core download page, choose Linux on the top.
- You'll need to download the ARM32 binaries package and install it manually. Click on All .NET Core downloads..., pick the latest version and Run apps - Runtime column find the .NET Core Runtime (version) section. Download the ARM32 package from the Linux Binaries.
- Rename this downloaded file to dotnet.tar.gz for easier handling below.
Here are the commands you'll need to enter into the Terminal:
#Install some possibly missing packages that will be needed. sudo apt-get install libunwind8 gettext curl wget #Make the dotnet directory where the .NET Core Runtime will be installed. sudo mkdir /usr/share/dotnet #Extract the files from the downloaded file. sudo tar -xvf dotnet.tar.gz -C /usr/share/dotnet/ #Set up a symbolic link to this directory so it will be found on path #when you type in the command "dotnet". sudo ln -s /usr/share/dotnet/dotnet /usr/local/bin
This works perfectly, the only caveat is that you'll need to perform this manual install with every updated .NET Core version you want to use.
Testing in the Terminal
Run this command to check whether the .NET Core Runtime has been installed successfully. It will list the currently installed version's details.
dotnet --info
Now you can run Retro Assembler with this command:
dotnet retroassembler.dll
Optional, but it is recommended to edit the command shell's startup file with a command alias to run Retro Assembler with ease, as if it was a Linux/Mac native command line application.
Open your user's home directory and edit the hidden file .bashrc on Linux, or .bash_profile on macOS. The latter usually doesn't exist and you have to create it. Then enter this line into the bash file with your chosen file path:
alias ra='dotnet ~/PATH/retroassembler.dll'
This will allow you to just enter the command ra and run the assembler from either the Terminal or from Visual Studio Code.