This week was a great week for .NET developers. .NET 6 is finally here and it’s awesome.

Do you want to install .NET 6 on your Pop_OS machine? One problem with Pop!_OS, it’s not listed in the official documentation from Microsoft. There aren’t really clear instructions for weirdos like me who like to develop .NET applications with this operating system.

No problem, it’s based on Ubuntu, right? So the Ubuntu or Snap instructions should work but they don’t.

You can run the dotnet script, and I’ve noticed that sometimes it works, and sometimes it’s tricky. Also you have to use sudo every time you run the dotnet command. Not optimal.

Here’s how you can install .NET 6 on Pop!_OS.

  • Don’t use Snap (it won’t work)
  • Don’t use the dotnet script (results can be wacky)

Do this instead.

How to Install .NET 6

A simple modification to the Ubuntu instructions works great.

First, run the following:

mkdir ~/src && cd ~/src
wget -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb

This sets up the appropriate packages.

Then, update everything:

sudo apt-get update; \
sudo apt-get install -y apt-transport-https && \
sudo apt-get update

Great! Now you can install the latest SDK and Runtime.

To Install the .NET SDK:

sudo apt-get install -y dotnet-sdk-6.0

To Install the ASP.NET Core Runtime:

sudo apt-get install -y aspnetcore-runtime-6.0

And you’re done!!

How to install .NET 6 in Pop!_OS

Note: I have .NET Core 5 installed also, your screen may not look like this

Try it out

You can test out your installation by building a small application.

dotnet new console -o HelloWorld

How to install .NET 6 in Pop!_OS

Now you can open your Hello World app, make a few changes and run it:

How to install .NET 6 in Pop!_OS

You might notice something different. It’s just a single line! The template has changed with C# 10, and that’s just the start. Dig in and have fun!

Questions, comments? Let me know!

Want to learn more about Linux? Of course you do. Check out this Linux Fundamentals course. You can sign up for a free trial here and take it today!

Get notified when new tutorials are posted:

Published: Nov 9, 2021 by Jeremy Morgan. Contact me before republishing this content.