Install .NET Core 2.2 On Ubuntu 18.04 Linux

In this blog post, I will show you how I install .NET Core 2.2 on my Azure Ubuntu 18.04 virtual machine and run the famous hello world application.

Get Started,

Before, you start, make sure you have the correct Ubuntu 18.04 build, In my case, I have also installed PowerShell Core for Linux on my Linux VM.

To start the installation, I have logged on to my VM and run the four commands below:

wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg
sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/
wget -q https://packages.microsoft.com/config/ubuntu/18.04/prod.list
sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list

Once the commands completed, I will run the four command below which will install .NET Core 2.2

sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-2.2

Check .NET Core Version

Now that the installation is completed, and I will check the installed .NET Core version using the line below

dotnet --version

Create C# Console App

To finish this article, I will create a test “Hello world” Console application using the commands below:

dotnet new console
dotnet run

Conclusion

There is no doubt that blockbuster tools from Microsoft can now run on any platform and I think it gives us flexibility in our deployments.

In my case, this is an advantage for many deployment cases.


Posted

in

, ,

by

Comments

2 responses to “Install .NET Core 2.2 On Ubuntu 18.04 Linux”

  1. Julia G Avatar
    Julia G

    Brilliant! The only tutorial that worked like a charm. Thanks!

  2. Venkat Avatar
    Venkat

    Thanks for your time. Worked Very well.