Leveling up Ubuntu for Developers: .NET Edition

Last month’s update was focused on our Java ecosystem and the various initiatives to enable Java developers and improve Java development experience on Ubuntu. Since that post, Pushkar Kulkarni provided additional context with these three posts:

I highly recommend checking them out! Thanks Pushkar Kulkarni!

Documentation update

Another notable update since my last post is that fantastic addition to our Ubuntu for developers documentation that highlights our Toolchains availability across Ubuntu releases as this is one of the most common requests we’re getting every 6 months!

That new page will take you to all our official toolchains and you will be able to see what versions are available for each Ubuntu Release. See below an example for Java

We will of course continue to maintain this page and likely automate its content for the future Ubuntu Release. Thanks to Dominik Viererbe for putting these pages together!

But now let’s focus on the main course : .NET toolchain!

.NET toolchain updates on Ubuntu

With the additional focus on toolchains in Ubuntu, our team is able to provide a wide range of features and updates to make Ubuntu the best platform to develop and run applications in the cloud, datacenter, and containers directly on the OS and anywhere Ubuntu can run. What does this mean for .NET ?

  • First, it means robust Ubuntu distro support with latest releases and timely updates in sync-step with upstream.
  • Next, it is about empowering developers and providing updated snaps and development tools to ease the development experience on Ubuntu.
  • Finally, it is about enabling developers to ship these applications as snaps or containers by improving integration with the Snapcraft and Rockcraft ecosystems.

And of course, keeping clear documentation with how-to guides, tutorials, and explanations in the Ubuntu for Developers documentation set.

Let’s look into this in detail.

Secure, timely, and reliable updates

When installing .NET from the Ubuntu archive, you will get and stay on the latest available version. At the end of 2022, we started collaborating with Microsoft to package, test, and deliver all monthly .NET updates for Ubuntu 22.04 and later. As .NET security partners, we receive early access to security patches directly from Microsoft. This allows us to package and test even embargoed patches before the official release date, enabling us to ship security releases simultaneously with Microsoft’s official .NET releases. This coordination provides immediate, day-one protection for your .NET applications on Ubuntu, safeguarding them against emerging threats and vulnerabilities.

Availability

Ubuntu LTS releases contain the most recent .NET LTS version at the time of the Ubuntu release and receive the following .NET LTS version when released as part of the main components of the Ubuntu archive.

But we are aware that application developers may need to have access to the latest .NET versions even on older Ubuntu releases or vice versa. We provide these additional backports via the .NET backports PPA.

For example:

  • Ubuntu 22.04 LTS contains .NET 6 LTS (released in November 2021) and .NET 8 LTS (released in November 2023); .NET 9 is available via the backports PPA.
  • Ubuntu 24.04 LTS contains .NET 8 LTS (released in November 2023) and will receive .NET 10 LTS (when released in November 2025); .NET 6, .NET 7, and .NET 9 are available via the backports PPA.

Please note that the packages in the .NET backports PPA are only maintained until the upstream end-of-life, but we are dedicated to maintaining .NET packages in the Ubuntu archive with Ubuntu Pro support, extending beyond the upstream end-of-life. For details on upstream end-of-life, refer to the .NET support policy.

Ubuntu interim releases will contain all supported .NET versions. More details on all versions available across Ubuntu releases can be found on the aforementioned updated new documentation page.

Architecture support

Beyond the amd64 and arm64 architectures that Microsoft offers, we also build and maintain .NET for s390x and ppc64el architectures, catering to enterprises leveraging IBM Z mainframes and Power Systems. This ensures their critical .NET workloads run optimally and securely on Ubuntu, unlocking new possibilities for performance and scalability in specialized environments.

.NET previews

Before each major .NET release, Microsoft publishes multiple previews for public testing. We package and test these previews in the .NET previews PPA to prepare for the final release. We encourage you to try them out and share your feedback!

.NET snap

To streamline the .NET installation experience on Ubuntu, we developed the .NET snap. This snap resolves key issues present in earlier .NET snaps. It features an installer that facilitates the side-by-side installation of multiple .NET SDKs and runtimes, utilizing the identical source-built binaries available from the Ubuntu archive.

The .NET snap is available on the Snap Store and compatible with Ubuntu 22.04 and later. For details on how to install and use the snap, refer to the Install and setup .NET guide from the Ubuntu Developer documentation.

We also provide .NET content snaps for both the .NET and ASP.NET runtimes, as well as the SDK. These content snaps enable the sharing of .NET runtimes and SDK across multiple .NET application snaps, leading to potential savings in storage space and faster installation times.

.NET Snapcraft plugin improvements

The developer experience for the .NET Snapcraft plugin has been enhanced. It now defaults to using Ubuntu source-built .NET SDK content snaps, offers improved support for monorepo setups, and integrates better with MSBuild through custom flag attributes.

The new plugin is now available on Snapcraft under a separate feature branch and will soon be released to Snapcraft stable. Any snap that uses core24 as base can leverage it. If you want to try it out, install or refresh Snapcraft to the latest/edge/dotnet channel.

sudo snap install --classic --channel=latest/edge/dotnet snapcraft

or

sudo snap refresh --channel=latest/edge/dotnet snapcraft

For more information on the new .NET plugin, refer to the craft-parts documentation.

Chiseled .NET Containers

Since November 2023, Canonical has offered .NET chiseled containers for all supported .NET versions. These are ultra-small, OCI-compliant images containing only your application and its runtime dependencies, omitting all other operating system-level packages or libraries. This ensures they are lightweight, secure, and efficient.

See also Microsoft’s blog article announcing .NET Chiseled Containers.

.NET documentation

To enhance the visibility, usability, and developer experience of our offerings, we provide comprehensive documentation tailored for .NET developers. This documentation covers a range of essential topics, including:

This documentation initiative is a recent development and is expected to expand further in the future.

Powershell snaps

We have recently started maintaining the PowerShell and PowerShell Preview snaps in the Snap Store. These snaps are built directly from source using the Ubuntu source-built .NET SDK and runtime, ensuring a consistent and transparent build process.

We encourage you to try them out and report any issues or suggestions in our powershell-snaps repository.

Looking into the future

.NET 10

The next major version of .NET is scheduled for release in November. We are actively packaging .NET 10 previews and making them available in the Previews PPA. Upon the release of the first .NET Release Candidate, it will be uploaded to the Ubuntu archive and made available on Ubuntu 25.10 at launch.

Furthermore, .NET 10 will be supported on our current LTS release, Ubuntu 24.04, as well as the upcoming LTS, Ubuntu 26.04.

.NET extension for Snapcraft

After providing a new experience for building .NET application snaps with the new .NET plugin on Snapcraft, we will also make available a .NET extension for Snapcraft.

With a single line of code in the application’s snapcraft.yaml file, developers can have the benefit of shipping .NET application snaps that leverage shared .NET runtime binaries from a content snap that’s kept up-to-date independently of the application itself. The benefit of this arrangement is that users can be sure that the .NET runtime their applications run on will always have the latest security fixes available.

.NET distro-specific customization

The .NET CLI tools currently reference Microsoft resources (e.g., the dotnet sdk check tool queries Microsoft’s release database, and help strings link to Microsoft documentation). We aim to replace this generic output with Ubuntu-specific information, such as suggesting apt install when a runtime or SDK is missing, thereby improving the developer experience.

It is worth repeating!

As we said in the previous post in this series, .NET and Java are the major application toolchains supported on Ubuntu and the ones we have been able to progress the most. But that’s not all, we are planning the same level of focus and integration for the other toolchains as well. Expect to see more developer experience improvements across the board soon. Stay tuned!

And Thanks to @samirkam, @dviererbe and @mateus-morais outstanding work supporting the .NET ecosystem for Ubuntu!

5 Likes