DEV Community

Shaikh Al Amin
Shaikh Al Amin

Posted on

How to install dotnet 6 in ubuntu 20.04

Download and install the below package:

wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
Enter fullscreen mode Exit fullscreen mode
sudo dpkg -i packages-microsoft-prod.deb
Enter fullscreen mode Exit fullscreen mode

How update the system and install transport https:

sudo apt install apt-transport-https && sudo apt update
Enter fullscreen mode Exit fullscreen mode

Now install dotnet SDK 6:

sudo apt install dotnet-sdk-6.0
Enter fullscreen mode Exit fullscreen mode

Also install dotnet core 6:

sudo apt install dotnet-runtime-6.0
Enter fullscreen mode Exit fullscreen mode

Check dotnet version:

dotnet --version
Enter fullscreen mode Exit fullscreen mode

Create hello world application:

dotnet new console -0 HelloWorld
Enter fullscreen mode Exit fullscreen mode

Run the hello world application :

cd HelloWorld/ && dotnet run
Enter fullscreen mode Exit fullscreen mode

For ubuntu 20.04 reference:

https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu-2004

For ubuntu 22.04 reference:

https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu-2204

Another good one:

https://tecadmin.net/how-to-install-dotnet-core-on-ubuntu-22-04/

Top comments (0)