-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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 .NET 6 on Ubuntu 22.04 (Jammy) #7699
Comments
Should we add these to https://docs.microsoft.com/en-us/dotnet/core/install/linux-package-mixup ? |
A set of modifications for the page was here too: dotnet/docs#30457 (comment) |
https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#2204 should be updated too. |
Can you elaborate @bastare? |
Tried the steps but to no avail.
|
This is specific to package version 6.0.8+. Downgrading to 6.0.7 resulted in the SDK showing. |
Did folks who are having this problem follow the instructions? If so, did you go with scenario 1 or 2? |
Thanks so much, I've been trying to fix the error for hours, Scenario 1 did it for me. Edit: I was using Ubuntu Jammy. |
I updated the scenarios to make them clearer. We now have two "Clean machine" scenarios and two "Mixed-state" scenarios. I've kept the numbering the same. BTW: We are very sorry that this situation occurred. We should have predicted that it would but sadly did not. That's on us. We've learned that mix-and-matching package feeds with the same package names that install to different locations is a recipe for what we're seeing here. Again, we're sorry about that and won't repeat it. |
Why is there this sudden change of installation steps? |
What do we do if we want powershell installed from PMC but to install SDK from jammy repo? Also removing and re-installing dotnet* and aspnetcore* did not fix the issue for me either. |
After some trial and error, found this github issue and went with "Clean machine scenario 2: Use .NET 6 Package via PMC" as this allows using the latest dotnet 6 sdk version. These instructions worked well. |
How can I get dotnet 5 SDK installed on 22.04 ? |
The dotnet team recently added support for installing natively from Jammy feeds on Ubuntu: dotnet/core#7699 This caused our current installation to fail, as it caused conflicts with the packages.microsoft.com feed we use in the install from source script for Debian/Ubuntu. This change separates the Ubuntu and Debian install from source processes, since Debian does not natively support Jammy feeds and continuing to try to install from packages.microsoft.com on Ubuntu would require munging the priority of feeds, which users would likely not appreciate. fixes
The dotnet team recently added support for installing natively from Jammy feeds on Ubuntu: dotnet/core#7699 This caused our current installation to fail, as it caused conflicts with the packages.microsoft.com feed we use in the install from source script for Debian/Ubuntu. This change separates the Ubuntu and Debian install from source processes, since Debian does not natively support Jammy feeds and continuing to try to install from packages.microsoft.com on Ubuntu would require munging the priority of feeds, which users would likely not appreciate. fixes
The dotnet team recently added support for installing natively from Jammy feeds on Ubuntu: dotnet/core#7699 This caused our current installation to fail, as it caused conflicts with the packages.microsoft.com feed we use in the install from source script for Debian/Ubuntu. This change separates the Ubuntu and Debian install from source processes, since Debian does not natively support Jammy feeds and continuing to try to install from packages.microsoft.com on Ubuntu would require munging the priority of feeds, which users would likely not appreciate. fixes
The dotnet team recently added support for installing natively from Jammy feeds on Ubuntu: dotnet/core#7699 This caused our current installation to fail, as it caused conflicts with the packages.microsoft.com feed we use in the install from source script for Debian/Ubuntu. This change separates the Ubuntu and Debian install from source processes, since Debian does not natively support Jammy feeds and continuing to try to install from packages.microsoft.com on Ubuntu would require munging the priority of feeds, which users would likely not appreciate. fixes
The dotnet team recently added support for installing natively from Jammy feeds on Ubuntu 22.04: dotnet/core#7699 This unfortunately created problems with our current install from source script, as it caused conflicts with the packages.microsoft.com feed we use in the install from for Debian/Ubuntu. This change modifies the Debian/Ubuntu dotnet install to install from Jammy feeds for users on Ubuntu 22.04 and greater while continuing to use the packages.microsoft.com feed for Debian and older Ubuntu versions.
In our company we're using a mirror with the same starting url for both feeds - PMC and Ubuntu sources. Hence pinning won't work by setting
Instead the following configuration works for me:
Just in case anybody has a similar issue... |
@mickdelaney Only .NET 6+ is supported on Ubuntu 22.04. That's unrelated to this discussion. See: #7038 (comment) .NET 6 is our first release to support OpenSSL v3. Ubuntu 22.04 only includes OpenSSL v3. As a result .NET 5 cannot function. You can install OpenSSL v1.x yourself if needed. We don't support that. Same thing with .NET Core 3.1. Also, .NET 5 is EOL. |
The dotnet team recently added support for installing natively from Jammy feeds on Ubuntu 22.04: dotnet/core#7699 This unfortunately created problems with our current install from source script, as it caused conflicts with the packages.microsoft.com feed we use in the install from for Debian/Ubuntu. This change modifies the Debian/Ubuntu dotnet install to install from Jammy feeds for users on Ubuntu 22.04 and greater while continuing to use the packages.microsoft.com feed for Debian and older Ubuntu versions.
The dotnet team recently added support for installing natively from Jammy feeds on Ubuntu 22.04: dotnet/core#7699 This unfortunately created problems with our current install from source script, as it caused conflicts with the packages.microsoft.com feed we use in the install from for Debian/Ubuntu. This change modifies the Debian/Ubuntu dotnet install to install from Jammy feeds for users on Ubuntu 22.04 and greater while continuing to use the packages.microsoft.com feed for Debian and older Ubuntu versions.
I have the same problem:
But:
I was able to make it work with SDK 6.0.16 but I need the SDK 6.0.408 for a project. I also try the script provide by Microsolf to install dotnet:
But still desn't detect when I run |
What I did to Installing .NET 7 on Ubuntu 22.04 (Jammy)
Then followed @kitingChris suggestion
That worked for me - everything else did not. |
I followed all the steps, still couldn't get anything back from
Googling this leads me to many other suggested solutions yet, of which none has worked yet. Man, I've been trying to upgrade from .NET 6 to .NET 7 on Ubuntu 22.04 for the last 3 hours now and not only does it not work, .NET is now completely broken and I'm unable to get it back into a working state again. What an abysmal experience. |
Ok if someone else comes here and thinks that .NET just doesn't seem to install on Ubuntu 22.04 then there's hope. This is the only solution that worked for me: First run this:
Then add this to your
|
@dustinmoris are you registering Microsoft package feed or rely on native Ubuntu package feeds? It seems that you do want to install 7.0.2xx feature band - solution for this scenario is provided in .NET 6 and 7 are provided in native Ubuntu feeds. The following page describes steps to install either .NET version on Ubuntu 22.04: https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu-2204 On that page, it is called out that only one package feed should be registered at the time to avoid issues you have hit. |
Ubuntu 22.04, .NET 6.0 - was originally set up using PMC, with the APT preferences file as described in this issue:
All seemed to work, but after last last night's unattended upgrade of the .NET packages we get the dreaded
So it seems that it somehow ended in the "mixed scenario", even though we had the APT preferences file - and it seems to have been effective on other machines during previous upgrades! /var/log/apt/term.log contains:
Edit: The problem was probably our unattended upgrades config, which had this:
So we allowed unattended upgrades from the Ubuntu APT source, but not from the MS one. The intention was to not upgrade .NET automatically (because that often breaks a running application!) so we've now added this:
Hopefully that's effective, but we won't know for sure until the next update of .NET is released. |
For those that wish to have unattended upgrades of dotnet, how about following https://askubuntu.com/a/1435868 and adding
|
@dustinmoris I hope no one tries to follow/read your comment, because it is very misplaced. This github issue is about Ubuntu packages of .NET x.y.z (which means, packages provided by the Ubuntu distribution, so that you can install directly with the native package manager tool |
This github issue is not a bug.
See the title of this issue, it's about .NET6. If you have issues with .NET9 open a new github issue? |
What issue? what tickets? sigh |
FYI on our plan for Ubuntu 24.04 packages |
After a recent machine rebuild, upgrading to Linux Mint 22.0 (equivalent to Ubuntu 24.04) I have the dotnet sdk 8.0 running happily. I now need to service an older application running on DotNet 6. I've been through your instructions and am left with:- sudo apt install dotnet-sdk-6.0 The following packages have unmet dependencies. What do you suggest? |
Looks like we Linux users are being done over by Microsoft again. Failing to provide consistent updates. Now the dotnet 9 sdk is only going to be available in Ubuntu format on Ubuntu distros. And that's after MS having insisted we not mix versions from different repos! I'm incandescent at their duplicity. After choosing MS's repos to get the latest and greatest I now have to remove dotnet completely and "make do" with what Ubuntu choose to provide. Which isn't the full set that had been available in the MS repos. Also I don't know what the differences may be between the official MS releases and the distro's release. I develop web sites professionally and need a mix of SDK's to support legacy and new projects. If anyone could help calm me down I'd appreciate it. |
I'm using .net 8 and .net 9 on Ubuntu 24.10 |
Thanks. I presume you're using them from the Ubuntu repos? How about .net 6 which I understand isn't available there? Are you noticing any issues with them? |
I had endless trouble with .net 6 and .net 7 because I tried the ms repo and the unbuntu repo. Now I only use ubuntu repo. |
Quite, I read the instructions and opted for the MS repo! Now I'll have to swap over. MS have little idea about customer service. Never have, which I why I've used Linux for the last 15 years. Canonical are as bad as MS which is why I switched from Ubunuto to Mint 12 years ago. Keeping with the MS repos was my idea of just having to deal with one incompetent company rather than two. Thanks for your insight. |
See the instructions in this post. They work with Ubuntu 22.04 and 24.04. You can install several .NET versions that way. EOL and STS versions are available via PPA. https://devblogs.microsoft.com/dotnet/whats-new-for-dotnet-in-ubuntu-2404/ I've started to document the commands at dotnet/sdk#45029. |
Installing .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. You need to apply the following guidance to install .NET 6 reliably and correctly on Ubuntu 22.04+.More information will be shared shortly on .NET 6 being available natively in the
jammy-updates
feed. In general, we recommend that you use the native packages from this feed since it is much easier and simpler.You can use one of the following scenarios:
Related:
Clean machine scenario 1: Use .NET 6 Package via Jammy feed
The easiest approach is to use the .NET 6 package available in Jammy feeds. In this scenario, just install
dotnet6
and don't register the PMC feed.You can do that via the following commands:
sudo apt update && sudo apt -y install dotnet6
You can see this demonstrated with Docker:
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.Clean machine scenario 2: Use .NET 6 Package via PMC
You can install .NET 6 on Ubuntu 22.04 from
packages.microsoft.com
using the following steps:Configure apt preferences, to prioritize PMC repository, by creating the following file:
/etc/apt/preferences
To create the file:
with contents:
Update your APT information:
sudo apt update
Install .NET SDK 6.0:
sudo apt install dotnet-sdk-6.0
Mixed state scenario 1: Use native Jammy packages after installing a previous .NET release from PMC
You may want to switch to using the .NET 6 package available in Jammy after installing .NET 6 from PMC.
Do the following:
sudo apt remove --purge dotnet*
sudo apt remove --purge aspnetcore*
sudo rm /etc/apt/sources.list.d/microsoft-prod.list
sudo apt update
sudo apt install dotnet-sdk-6.0
Mixed state scenario 2: Use PMC packages after installing native Jammy packages
You may want to switch to using
packages.microsoft.com
packages after installing native packages, potentially because you want to use6.0.4xx
builds.Do the following:
sudo apt remove --purge dotnet*
sudo apt remove --purge aspnetcore*
sudo apt install dotnet-sdk-6.0
How to identify which packages you'd installed
We'll install .NET 6 with both feeds, from a clean state, and then point the various ways you can identify which feed you installed the package from.
First, let's install the native Jammy packages using the "Clean machine scenario 1" guidance.
Notice that we've installed .NET SDK
6.0.108
, installed to/usr/lib/dotnet/
, and that thedotnet6
package is being installed fromhttp://archive.ubuntu.com/ubuntu jammy-updates/universe
. That's expected for the native packages.Let's try the same thing with PMC, but with the "Clean machine scenario 2" guidance.
Notice that we've installed .NET SDK
6.0.400
, installed to/usr/share/dotnet/
, and that thedotnet6
package is being installed fromhttps://packages.microsoft.com/ubuntu/22.04/prod jammy/main
. That's expected for PMC packages.We can also tell if the Microsoft PMC feed is registered:
If you are using native packages, that file won't and shouldn't be present.
The text was updated successfully, but these errors were encountered: