You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/core/install/linux-ubuntu.md
+36-21Lines changed: 36 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: .NET and Ubuntu overview
3
3
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.
@@ -48,7 +48,7 @@ Use the following sections to determine how you should install .NET:
48
48
49
49
### I'm using Ubuntu 22.04 or later, and I only need .NET
50
50
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:
52
52
53
53
-[Install .NET on Ubuntu 24.10](linux-ubuntu-install.md?pivots=os-linux-ubuntu-2410).
54
54
-[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
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
141
151
142
152
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.
143
153
144
154
See the [web-view of the Ubuntu .NET backports package repository](https://launchpad.net/~dotnet/+archive/ubuntu/backports) for more details.
145
155
146
-
### Register the Ubuntu .NET backports package repository
156
+
####Register the Ubuntu .NET backports package repository
147
157
148
158
Open a terminal and run the following command:
149
159
150
160
```bash
151
161
sudo add-apt-repository ppa:dotnet/backports
152
162
```
153
163
154
-
> [!TIP]
155
-
> You do not need to call `apt update`. The `add-apt-repository` command does this by default.
156
-
157
164
> [!NOTE]
158
165
> 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.
159
166
160
-
### Unregister the Ubuntu .NET backports package repository
167
+
####Unregister the Ubuntu .NET backports package repository
161
168
162
169
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:
> Unregistering the Ubuntu .NET backports package repository does not uninstall any packages.
170
177
171
-
### add-apt-repository command not found
178
+
####add-apt-repository command not found
172
179
173
180
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.
174
181
@@ -179,7 +186,7 @@ sudo apt update
179
186
sudo apt install software-properties-common
180
187
```
181
188
182
-
## Register the Microsoft package repository
189
+
###Register the Microsoft package repository
183
190
184
191
> [!IMPORTANT]
185
192
> 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
221
228
>
222
229
> 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.
223
230
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
225
236
226
237
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)):
227
238
@@ -239,7 +250,7 @@ Install .NET through the package manager with the `sudo apt install <package-nam
239
250
240
251
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).
241
252
242
-
## Uninstall .NET
253
+
###Uninstall .NET
243
254
244
255
If you installed .NET through a package manager, uninstall in the same way with the `apt-get remove` command:
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:
> 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.
271
274
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)]
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