Skip to content

Installing Powershell and .NET 6 on Ubuntu 22.04 (Jammy) #7713

@NikolaMilosavljevic

Description

@NikolaMilosavljevic

Installing Powershell and .NET 6 on Ubuntu 22.04 (Jammy)

We announced support for .NET 6 on Ubuntu 22.04 with our May 2022 Updates. At that time, the supported installation methods were manual installation via a tarball or a .deb package via packages.microsoft.com (PMC). .NET 6 is now available natively via Jammy feeds, which can cause conflicts with PMC feeds.

For specifics on installation of just .NET 6, see issue #7699

The following sections explain steps for installation of .NET 6 and Powershell, using packages from various available repositories.

Scenario 1: Install Powershell and .NET 6 from PMC repo

Install Powershell by following steps for installation from package repository: https://docs.microsoft.com/en-us/powershell/scripting/install/install-ubuntu?view=powershell-7.2#installation-via-package-repository

Configure apt preferences, to prioritize PMC repository, by creating the following file: /etc/apt/preferences

To create the file:

sudo touch /etc/apt/preferences

with contents:

Package: *
Pin: origin "packages.microsoft.com"
Pin-Priority: 1001

Update your APT information:

sudo apt update

Install .NET SDK 6.0:

sudo apt install dotnet-sdk-6.0

Scenario 2: Install Powershell from PMC, but .NET 6 from Ubuntu 22.04 (Jammy) repo

Install Powershell by following steps for installation from package repository: https://docs.microsoft.com/en-us/powershell/scripting/install/install-ubuntu?view=powershell-7.2#installation-via-package-repository

Configure apt preferences, to deprioritize PMC repository, by creating the following file: /etc/apt/preferences

To create the file:

sudo touch /etc/apt/preferences

with contents:

Package: *
Pin: origin "packages.microsoft.com"
Pin-Priority: 400

Update your APT information:

sudo apt update

Install .NET SDK 6.0:

sudo apt install dotnet-sdk-6.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-setupIssues related to installing .NET Core

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions