UPDATE: Microsoft added the official docs to Install .NET Core on Ubuntu 20.04 package manager.
UPDATE 2: Added link to scripted installation alternative Scripted Install
The newest Ubuntu LTS release is available now. Sadly, at the time of this writing (April 24th), there is no official installation method for Ubuntu 20.04 listed on the .Net website.
For this tutorial we are going to manually install DotNet Core 3.1.201 SDK using the binaries provided in the official page.
Head to .Net Core Downloads and look for the x64 Binaries in the Linux.
Alternatively you can use this link to get the specific version used in this tutorial.
After the download finishes, open a Terminal (you can use Super+Alt+T as a shortcut).
Navigate to the folder where it was downloaded and run the following command
mkdir -p $HOME/dotnet && tar zxf dotnet-sdk-3.1.201-linux-x64.tar.gz -C $HOME/dotnet
This command will create a dotnet folder on the user's home directory and extract there the contents of the file.
Note: Please be aware that the file name
dotnet-sdk-3.1.201-linux-x64.tar.gz matches the one you downloaded, otherwise you might need to modify the previous command accordingly to your download.
Run the following commands to temporarily add the dotnet binaries in your terminal session.
Note: This will work only for the current session, at the end of the tutorial you will find instructions to add it permanently.
dotnet in the Terminal, and the following should show appear:
Congratulations! You have installed dotnet core.
To add the dotnet commands permanently, you need to add the dotnet folder to the path of your system. To achieve this need to modify the
~/.bashrc file by running.
This will open an editor with the file contents. At the end of the file add the following two lines:
export PATH=$PATH:$HOME/dotnet export DOTNET_ROOT=$HOME/dotnet
Save the file (Ctrl+S) and close all the open Terminal windows. Next time you open a new one
dotnet will be available.
This is the official way to install dotnet core for Ubuntu based systems. The instructions for the 20.04 version can be found in Package Manager Install
It has been reported that some PopOS! users might have issues with the official and manual installation methods. In that case it might be solved by using the scripted install method whose instructions can be found in the following link Scripted Install. Thanks to Emma for the contribution.