dotnet/installer

dotnet-host-7.0 : Conflicts: dotnet-host

mcgiany opened this issue ยท 10 comments

Hi,
i try to install dotnet-sdk 8.0 on my Ubuntu 22.04 machine.
I already have sdk-7.0 installed.
I follow instruction on this site: https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu-2004
But when i run sudo apt-get install dotnet-sdk-8.0 i end up in error:

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 dotnet-host-7.0 : Conflicts: dotnet-host
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

Is there something i'm doing wrong?

Same issue, Ubuntu 22.04 in WSL.

Same issue here, Ubuntu 22.04 in WSL2. I had some problems when installing .NET 8 preview earlier this year, with .NET 7 installed. I had to remove .NET 7 to install .NET 8 preview. Not sure if that is supposed to be the case with preview versions.

Same behavior here under Ubuntu 23.04.

The aspnetcore-runtime-7.0 is already installed on my VPS.

declare repo_version=$(if command -v lsb_release &> /dev/null; then lsb_release -r -s; else grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '"'; fi)

wget https://packages.microsoft.com/config/ubuntu/$repo_version/packages-microsoft-prod.deb -O packages-microsoft-prod.deb

sudo dpkg -i packages-microsoft-prod.deb

sudo apt-get update &&  sudo apt-get install -y aspnetcore-runtime-8.0

Output

Hit:1 http://security.ubuntu.com/ubuntu lunar-security InRelease
Hit:2 http://nova.clouds.archive.ubuntu.com/ubuntu lunar InRelease
Hit:3 http://nova.clouds.archive.ubuntu.com/ubuntu lunar-updates InRelease
Hit:4 https://packages.microsoft.com/ubuntu/23.04/prod lunar InRelease
Hit:5 http://nova.clouds.archive.ubuntu.com/ubuntu lunar-backports InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 dotnet-host-7.0 : Conflicts: dotnet-host
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

Note: if I don't use the deb package, aspnetcore-runtime-8.0 is not found.

The aspnetcore-runtime-8.0 is now available

$ apt list | grep aspnet

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

aspnetcore-runtime-6.0/lunar-updates,lunar-security 6.0.125-0ubuntu1~23.04.1 amd64
aspnetcore-runtime-7.0/lunar-updates,lunar-security,now 7.0.114-0ubuntu1~23.04.1 amd64 [installed]
aspnetcore-runtime-8.0/lunar 8.0.0-1 amd64

Are you all installing 8.0 from the packages.microsoft.com feeds, or from the distro feeds? If from PMC, have you followed the steps in the doc for removing any .NET packages from the distro feeds and de-prioritizing the distro feeds for future installs of .NET packages? I tend to see these kinds of errors when folks have mixed package feeds set up, that's why I ask.

Ok, it might be the issue. I checked my current packages and some of them are probably from distro feeds.

dotnet-apphost-pack-7.0/jammy-updates,jammy-security,now 7.0.114-0ubuntu1~22.04.1 amd64 [installed,automatic]
dotnet-apphost-pack-8.0/focal,now 8.0.0-1 amd64 [installed,auto-removable]
dotnet-host-7.0/jammy-updates,jammy-security,now 7.0.114-0ubuntu1~22.04.1 amd64 [installed,automatic]
dotnet-hostfxr-7.0/jammy-updates,jammy-security,now 7.0.114-0ubuntu1~22.04.1 amd64 [installed,automatic]
dotnet-runtime-7.0/jammy-updates,jammy-security,now 7.0.114-0ubuntu1~22.04.1 amd64 [installed,automatic]
dotnet-runtime-deps-8.0/focal,now 8.0.0-1 amd64 [installed,auto-removable]
dotnet-sdk-7.0/focal,now 7.0.404-1 amd64 [installed]
dotnet-targeting-pack-7.0/jammy-updates,jammy-security,now 7.0.114-0ubuntu1~22.04.1 amd64 [installed,automatic]
dotnet-targeting-pack-8.0/focal,now 8.0.0-1 amd64 [installed,auto-removable]

Where i can find the docs about removing .NET packages from distro feeds?

The full docs are here - but pay special attention to the section on cleaning up an existing mixed installation.

@baronfel you saved me. Very helpful doc, i dont know why i didnt found it before. Now it works. Thank you so much. Issue can be closed.

sudo apt remove dotnet-sdk* dotnet-host* dotnet* aspnetcore* netstandard*
sudo apt remove aspnetcore*
sudo apt remove netstandard*
sudo apt remove dotnet-host*
sudo apt purge dotnet-sdk* dotnet-host* dotnet* aspnetcore* netstandard*
sudo rm -f /etc/apt/sources.list.d/mssql-release.list
sudo rm /etc/apt/sources.list.d/microsoft-prod.list
sudo rm /etc/apt/sources.list.d/microsoft-prod.list.save
sudo apt update
Install by App Center: .Net Core SDK, Stable 8.0.101
there is no need for other installations!
(sudo snap install dotnet-sdk #Installed by App Center
sudo apt install dotnet-sdk-8.0 #Installed by App Center
sudo apt install dotnet-host-8.0 #Installed by .Net Core SDK)
dotnet workload update
source ~/.bashrc
dotnet sdk check
.NET SDKs:
Version Status

8.0.100 Patch 8.0.101 is available.

dotnet --info
.NET SDK:
Version: 8.0.100

Workload version: 8.0.100-manifests.6c33ef20
OS Platform: Linux
RID: linux-x64
Base Path: /snap/dotnet-sdk/233/sdk/8.0.100/

Host:
Version: 8.0.0
Architecture: x64

dotnet --list-sdks
8.0.100 [/snap/dotnet-sdk/233/sdk]
dotnet --version
8.0.100