loading...
Cover image for Installing DotNet Core in Ubuntu 20.04

Installing DotNet Core in Ubuntu 20.04

carlos487 profile image Carlos Fabara Updated on ・2 min read

UPDATE: Microsoft added the official docs to Install .NET Core on Ubuntu 20.04 package manager I will update the post will the official documentation.

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 install DotNet Core 3.1.201 SDK using the binaries provided.

Download the binaries

Head to .Net Core Downloads and look for the x64 Binaries in the Linux.

Linux Binaries Download page

Alternatively you can use this link to get the specific version used in this tutorial.

Extract and link

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.

Export variables

Run the following commands to temporarily add the dotnet binaries in your terminal session.

export DOTNET_ROOT=$HOME/dotnet

and

export PATH=$PATH:$HOME/dotnet

Note: This will work only for the current session, at the end of the tutorial you will find instructions to add it permanently.

Test the installation

Run dotnet in the Terminal, and the following should show appear:

Alt Text

Congratulations! You have installed dotnet core.

Permanently add the dotnet command

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.

gedit ~/.bashrc

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.

Posted on Apr 24 by:

carlos487 profile

Carlos Fabara

@carlos487

Technology, programming and gadget enthusiast.

Discussion

markdown guide