Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
NikolaMilosavljevic opened this issue Aug 16, 2022 · 3 comments
Open

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

NikolaMilosavljevic opened this issue Aug 16, 2022 · 3 comments
Labels
area-setup Issues related to installing .NET Core

Comments

@NikolaMilosavljevic
Copy link
Member

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

@Jo-Zh
Copy link

Jo-Zh commented Aug 29, 2022

Thanks all, problems solved! I actually followed this #7699 with Mixed state scenario 1.

@Alexandersdr
Copy link

como criar este arquivo? Package: *
Pin: origin "packages.microsoft.com"
Pin-Priority: 1001

@tarekgh tarekgh added the area-setup Issues related to installing .NET Core label Feb 16, 2023
@moh-hassan
Copy link

moh-hassan commented Mar 4, 2024

Installing net6 SDK 6.0.419 from jammy in Ubuntu 22.04 , cause runtime not shown by the command ```dotnet --list-runtimes' and runtime 6 is not available for any net6 application.

I resolved the issue by installing from PMC
create or modify /etc/apt/preferences and add (you'll need sudo)

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

it is documented here

Note: This build of .NET 6 is for the 6.0.1xx band. 6.0.4xx builds are available via PMC. That difference matters most to Windows users. Both builds are supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-setup Issues related to installing .NET Core
Projects
None yet
Development

No branches or pull requests

5 participants