How to Install .NET on Linux and macOS
Updated on January 12, 2021⚑Retro Assembler.NETLinuxIf you want to use Retro Assembler to code on Linux (even on a Raspberry Pi) or on macOS, you have to install .NET on your computer. The current version is .NET 5.0 This used to be called .NET Core in previous versions, but Retro Assembler doesn't support those anymore. 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. Especially for ARM-based single board computers, see below.
Disclaimers
- During the time of writing this guide, the current .NET version is 5.0.2
- If there is a newer version by the time you read this, install that one.
- Only the .NET Runtime is needed to run applications like Retro Assembler therefore this guide focuses on that option.
- This guide assumes you use Ubuntu Linux 20.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, don't hold me responsible. But you should be just fine.
Installing on Windows
- Go to the .NET download page, choose Windows on the top.
- Click on Download .NET Core Runtime, then click on Download x64.
- Or you may download the full .NET SDK x64 installer.
Installing on macOS
- Go to the .NET download page, choose macOS on the top.
- Download the full .NET SDK installer.
Installing on Linux
- Go to the .NET download page, choose Linux on the top.
- Click on the Install .NET button and on the page it opens, scroll down to your chosen Linux distribution and version. Or here is a direct link to the Ubuntu 20.10 page which lists the installation steps.
Here are the commands you'll need to enter into the Terminal:
#Download the Ubuntu 20.10 related packages for the package manager. wget https://packages.microsoft.com/config/ubuntu/20.10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb #Install it for the package manager. sudo dpkg -i packages-microsoft-prod.deb #Update the package manager. sudo apt-get update #Install this utility. sudo apt-get install apt-transport-https #Update the package manager (again). sudo apt-get update #Install the .NET Runtime. sudo apt-get install dotnet-runtime-5.0 #Alternatively, Install the full .NET SDK sudo apt-get install dotnet-sdk-5.0
Installing on Raspberry Pi and on other ARM based SBCs
- Go to the .NET download page, choose Linux on the top.
- You'll need to download the ARM32 binaries package and install it manually. Click on All .NET downloads..., pick the latest version and in the Run apps - Runtime column (on the right side) find the .NET Runtime (version) section. Download the ARM32 package from the Linux Binaries.
- Here is a direct link to the now-latest version ARM32 5.0.2
- If you use a 64-bit OS, you may need the ARM64 package.
- 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 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 version you want to use.
Testing in the Terminal
Run this command to check whether the .NET 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.