Technology

Getting Started with .NET 10 on Ubuntu 26.04: A Complete Setup Guide

2026-05-05 02:46:17

Introduction

With the release of Ubuntu 26.04 (Resolute Raccoon), Canonical delivers the latest LTS with built-in support for .NET 10. Whether you're a developer building cloud-native applications or a system administrator deploying services, this guide walks you through installing, testing, and using .NET on the new Ubuntu. We'll cover installation from the official repositories, running your first C# script, working with Ubuntu 26.04 containers, and highlight key new features like post-quantum cryptography and cgroup v2. By the end, you'll have a fully functional .NET 10 environment ready for development or production.

Getting Started with .NET 10 on Ubuntu 26.04: A Complete Setup Guide
Source: devblogs.microsoft.com

What You Need

Step-by-Step Instructions

Step 1: Update Package List and Install .NET 10 SDK

Open a terminal and run the following commands to refresh the package database and install the .NET 10 SDK. Ubuntu 26.04 repositories include the dotnet-sdk-10.0 package directly.

sudo apt update
sudo apt install -y dotnet-sdk-10.0

This command installs the complete SDK, which includes the runtime, libraries, and command-line tools like dotnet.

Step 2: Verify the Installation

Check that .NET is installed correctly by displaying the version:

dotnet --version

You should see output like 10.0.105 (or a similar version number).

Step 3: Run Your First C# Code

You can quickly test that everything works by running a tiny C# script directly from the terminal using a heredoc. This approach is handy for quick experiments or even for AI agents to execute code.

dotnet run - << 'EOF'
using System.Runtime.InteropServices;

Console.WriteLine($"Hello {RuntimeInformation.OSDescription} from .NET {RuntimeInformation.FrameworkDescription}");
EOF

If successful, you'll see output similar to:

Hello Ubuntu Resolute Raccoon (development branch) from .NET .NET 10.0.5

This demonstrates that .NET is functioning and can access your system's OS description.

Step 4: (Optional) Install Older .NET Versions via PPA

While .NET 10 is the default LTS, you may need .NET 8 or 9 for compatibility. Canonical provides a separate PPA for these versions. Follow these substeps:

  1. Add the PPA repository:
    sudo add-apt-repository ppa:dotnet/backports
    sudo apt update
  2. Install the desired SDK or runtime:
    sudo apt install dotnet-sdk-8.0   # For .NET 8
    sudo apt install dotnet-sdk-9.0   # For .NET 9
  3. Switch between versions using the dotnet --list-sdks command and setting the DOTNET_ROOT environment variable if needed.

Step 5: Using Ubuntu 26.04 Container Images with .NET 10

Ubuntu 26.04 container images are available for .NET 10+ and use the resolute tag. To run .NET 10 inside a container:

Getting Started with .NET 10 on Ubuntu 26.04: A Complete Setup Guide
Source: devblogs.microsoft.com
docker run --rm -it ubuntu:resolute
apt update
apt install -y dotnet-sdk-10.0
dotnet --version

If you already use ubuntu:noble (24.04) images, you can simply replace noble with resolute to upgrade the base OS without changing your .NET version. The container image flavors (like Chiseled) remain the same as before.

Step 6: Understand Key New Features in Ubuntu 26.04 for .NET Developers

Ubuntu 26.04 introduces several changes that affect .NET applications:

Tips

Explore

Spider-Man's AI Companion Sparks Fury: 'Brand New Day' Script Leaks Reveal Loneliest Peter Parker Yet Get a Sneak Peek: Early Recreation of Google's New Workspace Icons Understanding Exposure Science: How Environmental Factors Shape Your Health Rust 1.94.1 Released: Security Patch and Regression Fixes New Device Combines Global Hotspot and Power Bank to End Traveler Woes