Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/core/install/includes/package-manager-switcher.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

> [!div class="op_single_selector"]
>
> - [Ubuntu 20.04 - x64](../linux-package-manager-ubuntu-2004.md)
> - [Ubuntu 19.10 - x64](../linux-package-manager-ubuntu-1910.md)
> - [Ubuntu 19.04 - x64](../linux-package-manager-ubuntu-1904.md)
> - [Ubuntu 18.04 - x64](../linux-package-manager-ubuntu-1804.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/core/install/linux-package-manager-ubuntu-1910.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ If that doesn't work, you can run a manual install with the following commands.

```bash
sudo apt-get install -y gpg
wget O- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o microsoft.asc.gpg
wget -O- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o microsoft.asc.gpg
sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/
wget https://packages.microsoft.com/config/ubuntu/19.10/prod.list
sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list
Expand Down
111 changes: 111 additions & 0 deletions docs/core/install/linux-package-manager-ubuntu-2004.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
---
title: Install .NET Core on Ubuntu 20.04 package manager - .NET Core
description: Use a package manager to install .NET Core SDK and runtime on Ubuntu 20.04.
author: thraka
ms.author: adegeo
ms.date: 04/15/2020
---

# Ubuntu 20.04 Package Manager - Install .NET Core

[!INCLUDE [package-manager-switcher](./includes/package-manager-switcher.md)]

This article describes how to use a package manager to install .NET Core on Ubuntu 20.04.

[!INCLUDE [package-manager-intro-sdk-vs-runtime](includes/package-manager-intro-sdk-vs-runtime.md)]

## Add Microsoft repository key and feed

Before installing .NET, you'll need to:

- Add the Microsoft package signing key to the list of trusted keys.
- Add the repository to the package manager.
- Install required dependencies.

This only needs to be done once per machine.

Open a terminal and run the following commands.

```bash
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
```

## Install the .NET Core SDK

Update the products available for installation, then install the .NET Core SDK. In your terminal, run the following commands.

```bash
sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-3.1
```

> [!IMPORTANT]
> If you receive an error message similar to **Unable to locate package dotnet-sdk-3.1**, see the [Troubleshoot the package manager](#troubleshoot-the-package-manager) section.

## Install the ASP.NET Core runtime

Update the products available for installation, then install the ASP.NET Core runtime. In your terminal, run the following commands.

```bash
sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install aspnetcore-runtime-3.1
```

> [!IMPORTANT]
> If you receive an error message similar to **Unable to locate package aspnetcore-runtime-3.1**, see the [Troubleshoot the package manager](#troubleshoot-the-package-manager) section.

## Install the .NET Core runtime

Update the products available for installation, then install the .NET Core runtime. In your terminal, run the following commands.

```bash
sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-runtime-3.1
```

> [!IMPORTANT]
> If you receive an error message similar to **Unable to locate package dotnet-runtime-3.1**, see the [Troubleshoot the package manager](#troubleshoot-the-package-manager) section.

## How to install other versions

[!INCLUDE [package-manager-switcher](./includes/package-manager-heading-hack-pkgname.md)]

## Troubleshoot the package manager

This section provides information on common errors you may get while using the package manager to install .NET Core.

### Unable to locate

If you receive an error message similar to **Unable to locate package {the .NET Core package}**, run the following commands.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should you have some examples of what "{the .NET Core package}" text would actually by? (Here and in the bash example?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have another update coming, I'll do something with this wording then.


```bash
sudo dpkg --purge packages-microsoft-prod && sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install {the .NET Core package}
```

If that doesn't work, you can run a manual install with the following commands.

```bash
sudo apt-get install -y gpg
wget -O- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o microsoft.asc.gpg
sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/
wget https://packages.microsoft.com/config/ubuntu/20.04/prod.list
sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list
sudo chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg
sudo chown root:root /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get install -y apt-transport-https
sudo apt-get update
sudo apt-get install {the .NET Core package}
```

### Failed to fetch

[!INCLUDE [package-manager-failed-to-fetch-deb](includes/package-manager-failed-to-fetch-deb.md)]
2 changes: 2 additions & 0 deletions docs/core/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
href: install/how-to-detect-installed-versions.md
- name: Linux package managers
items:
- name: Ubuntu 20.04
href: install/linux-package-manager-ubuntu-2004.md
- name: Ubuntu 19.10
href: install/linux-package-manager-ubuntu-1910.md
- name: Ubuntu 19.04
Expand Down