Skip to content

Commit 94c349e

Browse files
authored
Trim sections in Ubuntu overview article (#45103)
1 parent 75033a3 commit 94c349e

File tree

1 file changed

+36
-21
lines changed

1 file changed

+36
-21
lines changed

docs/core/install/linux-ubuntu.md

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: .NET and Ubuntu overview
33
description: Learn about the ways you can install .NET on Ubuntu, either from the built-in package feed, the .NET backports repository, or the Microsoft repository.
44
author: adegeo
55
ms.author: adegeo
6-
ms.date: 12/13/2024
6+
ms.date: 03/03/2025
77
ms.custom: updateeachrelease, linux-related-content
88
---
99

@@ -48,7 +48,7 @@ Use the following sections to determine how you should install .NET:
4848

4949
### I'm using Ubuntu 22.04 or later, and I only need .NET
5050

51-
Install .NET through the Ubuntu feed. For more information, see the following pages:
51+
If you don't need other Microsoft packages, such as `powershell`, `mdatp`, or `mssql`, install .NET through the Ubuntu feed. For more information, see the following pages:
5252

5353
- [Install .NET on Ubuntu 24.10](linux-ubuntu-install.md?pivots=os-linux-ubuntu-2410).
5454
- [Install .NET on Ubuntu 24.04](linux-ubuntu-install.md?pivots=os-linux-ubuntu-2404).
@@ -137,27 +137,34 @@ Canonical supports .NET versions in the built-in Ubuntu feed for the lifetime of
137137

138138
[!INCLUDE [versions-not-supported](includes/versions-not-supported.md)]
139139

140-
## Ubuntu .NET backports package repository
140+
## Register a package repository
141+
142+
Depending on your version of Ubuntu, you might need to register either the Ubuntu backports or the Microsoft package repository.
143+
144+
> [!IMPORTANT]
145+
> Make sure you consider the information in the [Decide how to install .NET section](#decide-how-to-install-net).
146+
147+
- [Register the Ubuntu .NET backports package repository](#ubuntu-net-backports-package-repository)
148+
- [Register the Microsoft package repository](#register-the-microsoft-package-repository)
149+
150+
### Ubuntu .NET backports package repository
141151

142152
The Ubuntu .NET backports package repository provides versions of .NET that aren't available in the built-in Ubuntu feed. The [Supported distributions](#supported-distributions) section provides a table that lists which versions of .NET are available in the package feed. Canonical maintains the packages contained in this package repository and provides best-effort support, which does not extend beyond the Microsoft-provided support lifetime or the support period of the particular Ubuntu version.
143153

144154
See the [web-view of the Ubuntu .NET backports package repository](https://launchpad.net/~dotnet/+archive/ubuntu/backports) for more details.
145155

146-
### Register the Ubuntu .NET backports package repository
156+
#### Register the Ubuntu .NET backports package repository
147157

148158
Open a terminal and run the following command:
149159

150160
```bash
151161
sudo add-apt-repository ppa:dotnet/backports
152162
```
153163

154-
> [!TIP]
155-
> You do not need to call `apt update`. The `add-apt-repository` command does this by default.
156-
157164
> [!NOTE]
158165
> The Ubuntu .NET backports package repository is compatible with the built-in Ubuntu feed. Therefore you do not need to configure your package manager to ignore .NET packages in the built-in Ubuntu feed.
159166
160-
### Unregister the Ubuntu .NET backports package repository
167+
#### Unregister the Ubuntu .NET backports package repository
161168

162169
If you no longer want to consume packages from the Ubuntu .NET backports package repository you can unregister it. Open a terminal and run the following command:
163170

@@ -168,7 +175,7 @@ sudo add-apt-repository --remove ppa:dotnet/backports
168175
> [!IMPORTANT]
169176
> Unregistering the Ubuntu .NET backports package repository does not uninstall any packages.
170177
171-
### add-apt-repository command not found
178+
#### add-apt-repository command not found
172179

173180
The [`add-apt-repository(1)`](https://manpages.ubuntu.com/manpages/noble/en/man1/add-apt-repository.1.html) utility is pre-installed on most Ubuntu installations.
174181

@@ -179,7 +186,7 @@ sudo apt update
179186
sudo apt install software-properties-common
180187
```
181188

182-
## Register the Microsoft package repository
189+
### Register the Microsoft package repository
183190

184191
> [!IMPORTANT]
185192
> This only applies to Ubuntu versions prior to 24.04. Starting with Ubuntu 24.04, Microsoft no longer publishes packages to the Microsoft package repository. Use the [supported distributions table](#supported-distributions) to determine the best way to install .NET.
@@ -221,7 +228,11 @@ sudo apt update
221228
>
222229
> You can use a web browser and navigate to <https://packages.microsoft.com/config/ubuntu/> to see which versions of Ubuntu are available to use as the `$repo_version` value.
223230
224-
## Install .NET
231+
## Install, uninstall, or update .NET
232+
233+
The following sections describe how to manage .NET through the package manager.
234+
235+
### Install .NET
225236

226237
Install .NET through the package manager with the `sudo apt install <package-name>` command. Replace `<package-name>` with the name of the .NET package you want to install. For example, to install .NET SDK 9.0, use the command `sudo apt install dotnet-sdk-9.0`. The following table lists the currently supported .NET packages (which [might vary by your Ubuntu version](#supported-distributions)):
227238

@@ -239,7 +250,7 @@ Install .NET through the package manager with the `sudo apt install <package-nam
239250
240251
Some environment variables affect how .NET is run after it's installed. For more information, see [.NET SDK and CLI environment variables](../tools/dotnet-environment-variables.md#net-sdk-and-cli-environment-variables).
241252

242-
## Uninstall .NET
253+
### Uninstall .NET
243254

244255
If you installed .NET through a package manager, uninstall in the same way with the `apt-get remove` command:
245256

@@ -249,15 +260,7 @@ sudo apt-get remove dotnet-sdk-6.0
249260

250261
For more information, see [Uninstall .NET](remove-runtime-sdk-versions.md?pivots=os-linux#uninstall-net).
251262

252-
## Install preview versions
253-
254-
[!INCLUDE [preview installs don't support package managers](./includes/linux-install-previews.md)]
255-
256-
## Remove preview versions
257-
258-
[!INCLUDE [package-manager uninstall notice](./includes/linux-uninstall-preview-info.md)]
259-
260-
## Use APT to update .NET
263+
### Update .NET
261264

262265
If you installed .NET through a package manager, you can upgrade the package with the `apt upgrade` command. For example, the following commands upgrade the `dotnet-sdk-9.0` package with the latest version:
263266

@@ -269,6 +272,18 @@ sudo apt upgrade dotnet-sdk-9.0
269272
> [!TIP]
270273
> If you've upgraded your Linux distribution since installing .NET, you may need to reconfigure the Microsoft package repository. Run the installation instructions for your current distribution version to upgrade to the appropriate package repository for .NET updates.
271274
275+
## Manage preview versions
276+
277+
The following sections describe how to install and uninstall preview releases of .NET.
278+
279+
### Install preview versions
280+
281+
[!INCLUDE [preview installs don't support package managers](./includes/linux-install-previews.md)]
282+
283+
### Remove preview versions
284+
285+
[!INCLUDE [package-manager uninstall notice](./includes/linux-uninstall-preview-info.md)]
286+
272287
## Troubleshooting
273288

274289
Starting with Ubuntu 22.04, you might run into a situation where it seems only a piece of .NET is available. For example, you've installed the runtime and the SDK, but when you run `dotnet --info` only the runtime is listed. This situation can be related to using two different package sources. The built-in Ubuntu 22.04 and Ubuntu 22.10 package feeds include some versions of .NET, but not all, and you might have also installed .NET from the Microsoft feeds. For more information about how to fix this problem, see [Troubleshoot .NET errors related to missing files on Linux](linux-package-mixup.md?pivots=os-linux-ubuntu#solutions).

0 commit comments

Comments
 (0)