This article discusses how to install .NET on Ubuntu.
Install the SDK (which includes the runtime) if you want to develop .NET apps. Or, if you only need to run apps, install the Runtime. If you're installing the Runtime, we suggest you install the ASP.NET Core Runtime as it includes both .NET and ASP.NET Core runtimes.
Using a package manager to install .NET from the Microsoft package feed only supports the x64 architecture. Other architectures, such as Arm, aren't supported by the Microsoft package feed. Use the Ubuntu feeds or manually install .NET. Be cautious of package mix up problems when using multiple feeds. For more information, see .NET package mix ups on Linux.
For more information on installing .NET without a package manager, see one of the following articles:
.NET 9 was released on November 12, 2024. It may take time for the packages to appear in the package manager feeds, or for your specific Linux distribution to include it.
Install the SDK
The .NET SDK allows you to develop apps with .NET. If you install the .NET SDK, you don't need to install the corresponding runtime. To install the .NET SDK, run the following commands:
The ASP.NET Core Runtime allows you to run apps that were made with .NET that didn't provide the runtime. The following commands install the ASP.NET Core Runtime, which is the most compatible runtime for .NET. In your terminal, run the following commands:
As an alternative to the ASP.NET Core Runtime, you can install the .NET Runtime, which doesn't include ASP.NET Core support: replace aspnetcore-runtime-9.0 in the previous command with dotnet-runtime-9.0:
The .NET SDK allows you to develop apps with .NET. If you install the .NET SDK, you don't need to install the corresponding runtime. To install the .NET SDK, run the following commands:
The ASP.NET Core Runtime allows you to run apps that were made with .NET that didn't provide the runtime. The following commands install the ASP.NET Core Runtime, which is the most compatible runtime for .NET. In your terminal, run the following commands:
As an alternative to the ASP.NET Core Runtime, you can install the .NET Runtime, which doesn't include ASP.NET Core support: replace aspnetcore-runtime-8.0 in the previous command with dotnet-runtime-8.0:
When you install with a package manager, these libraries are installed for you. But, if you manually install .NET or you publish a self-contained app, you'll need to make sure these libraries are installed:
ca-certificates
libc6
libgcc-s1
libicu74
liblttng-ust1
libssl3
libstdc++6
libunwind8
zlib1g
Dependencies can be installed with the apt install command. The following snippet demonstrates installing the zlib1g library:
.NET is available in the Ubuntu package manager feeds, as well as the Microsoft package repository. However, you should only use one or the other to install .NET. Microsoft recommends that you use the Ubuntu package manager feeds. If you want to use the Microsoft package repository, see How to register the Microsoft package repository.
The following versions of .NET are supported or available for Ubuntu 24.04:
.NET 9 was released on November 12, 2024. It may take time for the packages to appear in the package manager feeds, or for your specific Linux distribution to include it.
Not published by Microsoft.
Install the SDK
The .NET SDK allows you to develop apps with .NET. If you install the .NET SDK, you don't need to install the corresponding runtime. To install the .NET SDK, run the following commands:
The ASP.NET Core Runtime allows you to run apps that were made with .NET that didn't provide the runtime. The following commands install the ASP.NET Core Runtime, which is the most compatible runtime for .NET. In your terminal, run the following commands:
As an alternative to the ASP.NET Core Runtime, you can install the .NET Runtime, which doesn't include ASP.NET Core support: replace aspnetcore-runtime-8.0 in the previous command with dotnet-runtime-8.0:
.NET 6 is available in the Ubuntu backports package repository for Ubuntu 24.04, and not the built-in package repository. For more information, see Register the Ubuntu backports package repository. After the repository is registered, use the following sections to install .NET.
Upozornenie
.NET 6 is no longer supported.
Install the SDK
The .NET SDK allows you to develop apps with .NET. If you install the .NET SDK, you don't need to install the corresponding runtime. To install the .NET SDK, run the following commands:
The ASP.NET Core Runtime allows you to run apps that were made with .NET that didn't provide the runtime. The following command installs the ASP.NET Core Runtime, which is the most compatible runtime for .NET. In your terminal, run the following commands:
As an alternative to the ASP.NET Core Runtime, you can install the .NET Runtime, which doesn't include ASP.NET Core support: replace aspnetcore-runtime-6.0 in the previous command with dotnet-runtime-6.0:
When you install with a package manager, these libraries are installed for you. But, if you manually install .NET or you publish a self-contained app, you'll need to make sure these libraries are installed:
ca-certificates
libc6
libgcc-s1
libicu74
liblttng-ust1
libssl3
libstdc++6
libunwind8
zlib1g
Dependencies can be installed with the apt install command. The following snippet demonstrates installing the zlib1g library:
.NET is available in the Ubuntu package manager feeds, as well as the Microsoft package repository. However, you should only use one or the other to install .NET. Microsoft recommends that you use the Ubuntu package manager feeds. If you want to use the Microsoft package repository, see How to register the Microsoft package repository.
The following versions of .NET are supported or available for Ubuntu 22.04:
If you're using .NET 8 SDK and Ubuntu 22.04, understand that SDK versions offered by Canonical are always in the .1xx feature band. If you want to use a newer feature band release, use the Microsoft feed to install the SDK. Make sure you review the information in the .NET package mix ups on Linux article to understand the implications of switching between repository feeds.
When an Ubuntu version falls out of support, .NET is no longer supported with that version.
.NET 9 was released on November 12, 2024. It may take time for the packages to appear in the package manager feeds, or for your specific Linux distribution to include it.
Not published by Microsoft.
Install the SDK
The .NET SDK allows you to develop apps with .NET. If you install the .NET SDK, you don't need to install the corresponding runtime. To install the .NET SDK, run the following commands:
The ASP.NET Core Runtime allows you to run apps that were made with .NET that didn't provide the runtime. The following commands install the ASP.NET Core Runtime, which is the most compatible runtime for .NET. In your terminal, run the following commands:
As an alternative to the ASP.NET Core Runtime, you can install the .NET Runtime, which doesn't include ASP.NET Core support: replace aspnetcore-runtime-8.0 in the previous command with dotnet-runtime-8.0:
The .NET SDK allows you to develop apps with .NET. If you install the .NET SDK, you don't need to install the corresponding runtime. To install the .NET SDK, run the following commands:
The ASP.NET Core Runtime allows you to run apps that were made with .NET that didn't provide the runtime. The following command installs the ASP.NET Core Runtime, which is the most compatible runtime for .NET. In your terminal, run the following commands:
As an alternative to the ASP.NET Core Runtime, you can install the .NET Runtime, which doesn't include ASP.NET Core support: replace aspnetcore-runtime-6.0 in the previous command with dotnet-runtime-6.0:
When you install with a package manager, these libraries are installed for you. But, if you manually install .NET or you publish a self-contained app, you'll need to make sure these libraries are installed:
ca-certificates
libc6
libgcc-s1
libgssapi-krb5-2
libicu70
liblttng-ust1
libssl3
libstdc++6
libunwind8
zlib1g
Dependencies can be installed with the apt install command. The following snippet demonstrates installing the zlib1g library:
When an Ubuntu version falls out of support, .NET is no longer supported with that version.
Add the Microsoft package repository
Installing with APT can be done with a few commands. Before you install .NET, run the following commands to add the Microsoft package signing key to your list of trusted keys and add the package repository.
Because Ubuntu 20.04 reaches end of life in April 2025, Microsoft has decided not to support .NET 9 on Ubuntu 20.04.
Install the SDK
The .NET SDK allows you to develop apps with .NET. If you install the .NET SDK, you don't need to install the corresponding runtime. To install the .NET SDK, run the following commands:
The ASP.NET Core Runtime allows you to run apps that were made with .NET that didn't provide the runtime. The following commands install the ASP.NET Core Runtime, which is the most compatible runtime for .NET. In your terminal, run the following commands:
As an alternative to the ASP.NET Core Runtime, you can install the .NET Runtime, which doesn't include ASP.NET Core support: replace aspnetcore-runtime-8.0 in the previous command with dotnet-runtime-8.0:
The .NET SDK allows you to develop apps with .NET. If you install the .NET SDK, you don't need to install the corresponding runtime. To install the .NET SDK, run the following commands:
The ASP.NET Core Runtime allows you to run apps that were made with .NET that didn't provide the runtime. The following command installs the ASP.NET Core Runtime, which is the most compatible runtime for .NET. In your terminal, run the following commands:
As an alternative to the ASP.NET Core Runtime, you can install the .NET Runtime, which doesn't include ASP.NET Core support: replace aspnetcore-runtime-6.0 in the previous command with dotnet-runtime-6.0:
When you install with a package manager, these libraries are installed for you. But, if you manually install .NET or you publish a self-contained app, you'll need to make sure these libraries are installed:
ca-certificates
libc6
libgcc-s1
libgssapi-krb5-2
libicu66
libssl1.1
libstdc++6
zlib1g
Dependencies can be installed with the apt install command. The following snippet demonstrates installing the zlib1g library:
The following versions of .NET are ❌ no longer supported:
.NET 7
.NET 6
.NET 5
.NET Core 3.1
.NET Core 3.0
.NET Core 2.2
.NET Core 2.1
.NET Core 2.0
How to install other versions
.NET package names are standardized across all Linux distributions. The following table lists the packages:
All versions of .NET are available for download at https://dotnet.microsoft.com/download/dotnet, but require manual installation. You can try to use the package manager to install a different version of .NET. However, the requested version might not be available.
The packages added to package manager feeds are named in a hackable format, for example: {product}-{type}-{version}.
product
The type of .NET product to install. Valid options are:
dotnet
aspnetcore
type
Chooses the SDK or the runtime. Valid options are:
sdk (only available for the dotnet product)
runtime
version
The version of the SDK or runtime to install. Valid options are any released version, such as:
9.0
8.0
3.1
2.1
It's possible the SDK/runtime you're trying to download isn't available for your Linux distribution. For a list of supported distributions, see Install .NET on Linux.
Examples
Install the ASP.NET Core 9.0 runtime: aspnetcore-runtime-9.0
Install the .NET Core 2.1 runtime: dotnet-runtime-2.1
Install the .NET 5 SDK: dotnet-sdk-5.0
Install the .NET Core 3.1 SDK: dotnet-sdk-3.1
Poznámka
Some package might not be available on your Linux distribution.
Package missing
If the package-version combination doesn't work, it's not available. For example, there isn't an ASP.NET Core SDK. The SDK components for ASP.NET Core are included with the .NET SDK. The value aspnetcore-sdk-8.0 is incorrect and should be dotnet-sdk-8.0. For a list of Linux distributions supported by .NET, see .NET dependencies and requirements.
Manual install
If your Ubuntu version isn't supported, you most likely need to install .NET by manually extracting the binaries, by using the install script. For more information, see Install .NET on Linux without using a package manager.
Ubuntu 23.10
Upozornenie
This version of Ubuntu is no longer supported.
Running .NET on this version of Ubuntu is no longer supported.
.NET is available in the Ubuntu package manager feeds, as well as the Microsoft package repository. However, you should only use one or the other to install .NET. Microsoft recommends that you use the Ubuntu package manager feeds. If you want to use the Microsoft package repository, see How to register the Microsoft package repository.
The following versions of .NET were supported or available for Ubuntu 23.10:
If you're using .NET 8 SDK and Ubuntu 22.04, understand that SDK versions offered by Canonical are always in the .1xx feature band. If you want to use a newer feature band release, use the Microsoft feed to install the SDK. Make sure you review the information in the .NET package mix ups on Linux article to understand the implications of switching between repository feeds.
When an Ubuntu version falls out of support, .NET is no longer supported with that version.
The .NET SDK allows you to develop apps with .NET. If you install the .NET SDK, you don't need to install the corresponding runtime. To install the .NET SDK, run the following commands:
The ASP.NET Core Runtime allows you to run apps that were made with .NET that didn't provide the runtime. The following commands install the ASP.NET Core Runtime, which is the most compatible runtime for .NET. In your terminal, run the following commands:
As an alternative to the ASP.NET Core Runtime, you can install the .NET Runtime, which doesn't include ASP.NET Core support: replace aspnetcore-runtime-8.0 in the previous command with dotnet-runtime-8.0:
The .NET SDK allows you to develop apps with .NET. If you install the .NET SDK, you don't need to install the corresponding runtime. To install the .NET SDK, run the following commands:
The ASP.NET Core Runtime allows you to run apps that were made with .NET that didn't provide the runtime. The following command installs the ASP.NET Core Runtime, which is the most compatible runtime for .NET. In your terminal, run the following commands:
As an alternative to the ASP.NET Core Runtime, you can install the .NET Runtime, which doesn't include ASP.NET Core support: replace aspnetcore-runtime-6.0 in the previous command with dotnet-runtime-6.0:
When you install with a package manager, these libraries are installed for you. But, if you manually install .NET or you publish a self-contained app, you'll need to make sure these libraries are installed:
ca-certificates
libc6
libgcc-s1
libgssapi-krb5-2
libicu72
liblttng-ust1
libssl3
libstdc++6
libunwind8
zlib1g
Dependencies can be installed with the apt install command. The following snippet demonstrates installing the zlib1g library:
Running .NET on this version of Ubuntu is no longer supported.
.NET is available in the Ubuntu package manager feeds, as well as the Microsoft package repository. However, you should only use one or the other to install .NET. Microsoft recommends that you use the Ubuntu package manager feeds. If you want to use the Microsoft package repository, see How to register the Microsoft package repository.
The following versions of .NET were supported or available for Ubuntu 23.04:
If you're using .NET 8 SDK and Ubuntu 22.04, understand that SDK versions offered by Canonical are always in the .1xx feature band. If you want to use a newer feature band release, use the Microsoft feed to install the SDK. Make sure you review the information in the .NET package mix ups on Linux article to understand the implications of switching between repository feeds.
The .NET SDK allows you to develop apps with .NET. If you install the .NET SDK, you don't need to install the corresponding runtime. To install the .NET SDK, run the following commands:
The ASP.NET Core Runtime allows you to run apps that were made with .NET that didn't provide the runtime. The following commands install the ASP.NET Core Runtime, which is the most compatible runtime for .NET. In your terminal, run the following commands:
As an alternative to the ASP.NET Core Runtime, you can install the .NET Runtime, which doesn't include ASP.NET Core support: replace aspnetcore-runtime-8.0 in the previous command with dotnet-runtime-8.0:
The .NET SDK allows you to develop apps with .NET. If you install the .NET SDK, you don't need to install the corresponding runtime. To install the .NET SDK, run the following commands:
The ASP.NET Core Runtime allows you to run apps that were made with .NET that didn't provide the runtime. The following command installs the ASP.NET Core Runtime, which is the most compatible runtime for .NET. In your terminal, run the following commands:
As an alternative to the ASP.NET Core Runtime, you can install the .NET Runtime, which doesn't include ASP.NET Core support: replace aspnetcore-runtime-6.0 in the previous command with dotnet-runtime-6.0:
When you install with a package manager, these libraries are installed for you. But, if you manually install .NET or you publish a self-contained app, you'll need to make sure these libraries are installed:
ca-certificates
libc6
libgcc-s1
libgssapi-krb5-2
libicu72
liblttng-ust1
libssl3
libstdc++6
libunwind8
zlib1g
Dependencies can be installed with the apt install command. The following snippet demonstrates installing the zlib1g library:
Running .NET on this version of Ubuntu is no longer supported.
.NET is available in the Ubuntu package manager feeds, as well as the Microsoft package repository. However, you should only use one or the other to install .NET. Microsoft recommends that you use the Ubuntu package manager feeds. If you want to use the Microsoft package repository, see How to register the Microsoft package repository.
The following versions of .NET are supported or available for Ubuntu 22.10:
If you're using .NET 8 SDK and Ubuntu 22.04, understand that SDK versions offered by Canonical are always in the .1xx feature band. If you want to use a newer feature band release, use the Microsoft feed to install the SDK. Make sure you review the information in the .NET package mix ups on Linux article to understand the implications of switching between repository feeds.
The .NET SDK allows you to develop apps with .NET. If you install the .NET SDK, you don't need to install the corresponding runtime. To install the .NET SDK, run the following commands:
The ASP.NET Core Runtime allows you to run apps that were made with .NET that didn't provide the runtime. The following command installs the ASP.NET Core Runtime, which is the most compatible runtime for .NET. In your terminal, run the following commands:
As an alternative to the ASP.NET Core Runtime, you can install the .NET Runtime, which doesn't include ASP.NET Core support: replace aspnetcore-runtime-6.0 in the previous command with dotnet-runtime-6.0:
When you install with a package manager, these libraries are installed for you. But, if you manually install .NET or you publish a self-contained app, you'll need to make sure these libraries are installed:
ca-certificates
libc6
libgcc-s1
libgssapi-krb5-2
libicu71
liblttng-ust1
libssl3
libstdc++6
libunwind8
zlib1g
Dependencies can be installed with the apt install command. The following snippet demonstrates installing the zlib1g library:
Zdroj tohto obsahu nájdete v službe GitHub, kde môžete vytvárať a skúmať problémy a žiadosti o prijatie zmien. Ďalšie informácie nájdete v našom sprievodcovi prispievateľom.
Pripomienky k produktu .NET
.NET je open-source projekt. Ak chcete poskytnúť pripomienky, vyberte prepojenie:
.NET is a free, cross-platform, open source developer platform for building many different types of applications. With .NET, you can use multiple languages, editors, and libraries to build for web, mobile, desktop, games, and IoT.