Get .NET Core 3.1 on Ubuntu 20.04

Ubuntu 20.04 LTS is just released on 23 April 2020 and being deployed to cloud providers like AWS or Azure. So, now you have running Ubuntu 20.04, how to get .NET Core 3.1?

Based on the issue this GitHub, the sudo apt-get is not yet ready for .NET Core 3.1. So, what if you want to test something on it? You can use below command. At the time of writing, the latest version is 3.1.2. You can latest version number at https://dotnet.microsoft.com/download/dotnet-core, then you can change the 3.1.2 below.

$ sudo snap install dotnet-sdk --channel=3.1.2
$ sudo snap alias dotnet-sdk.dotnet dotnet

Now, above is using snap, so installation will be at /snap/, not /etc/. So, if you need to run .NET Core 3.1 application, you need to map the working path at /snap/.

The second command will map alias dotnet. So you can call dotnet application like you installed normally.

You may also need to add --classic at the snap installation command to acknowledges the fact that you are not installing a snap in strict confinement.

$ sudo snap install dotnet-sdk --channel=3.1.2 --classic

Once you done, you can use dotnet --info to confirm. You should see the screenshot as below.

I also hosting a .NET Core 3.1 site on Ubuntu 20.04 LTS now which help C# developers to convert JSON String to C# Classes easily at https://json2csharp.melicaster.com/. Source code is available at my GitHub.

You can also know what versions is available to install in your machine by using snap info dotnet-sdk.

Have a nice day.

By melicaster

Avid programmer. Was a system analyst who worked with financial industry. Now working as consultant capacity to help companies across Asia and Australia to do digital transformation.

Leave a comment

Your email address will not be published. Required fields are marked *