Microsoft Packaged Linux Software (DEBs, RPMs, etc) are hosted on packages.microsoft.com (PMC) made available as native Linux repositories for use with package managers like APT, YUM, etc.
Today, after an automatic reboot for a kernel update, I woke up to find a dotnet-related unattended upgrade had clobbered one of my dotnet-powered servers:
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '8.0.0' (x64)
.NET location: /usr/share/dotnet
No frameworks were found.
It seems like what happened is during an automatic update, apt pulled the updated ubuntu-provided package instead of the microsoft-provided package and that left dotnet in a broken state until a manual update fixed things.
Regardless, I quickly realized the problem was the suddenly missing deps package and a simple apt dist-upgrade fixed it, but I thought it worth raising in case I have things misconfigured or otherwise would like to avoid having a similar issue in future.
Logs
In /var/log/unattended-upgrades/unattended-upgrades.log I can see the problem seems to be dotnet-runtime-deps-8.0 got auto-removed for some reason. Possibly it is due to dotnet-hostfxr-8.0 being kept back for some reason:
2024-07-11 06:06:10,993 INFO Starting unattended upgrades script
2024-07-11 06:06:10,993 INFO Allowed origins are: o=Ubuntu,a=jammy, o=Ubuntu,a=jammy-security, o=UbuntuESMApps,a=jammy-apps-security, o=UbuntuESM,a=jammy-inf
ra-security
2024-07-11 06:06:10,994 INFO Initial blacklist:
2024-07-11 06:06:10,994 INFO Initial whitelist (not strict):
2024-07-11 06:06:12,906 INFO Packages that will be upgraded: aspnetcore-runtime-8.0 aspnetcore-targeting-pack-8.0 dotnet-apphost-pack-8.0 dotnet-runtime-8.0
dotnet-targeting-pack-8.0 libpython3.10 libpython3.10-dev libpython3.10-minimal libpython3.10-stdlib netstandard-targeting-pack-2.1 python3.10 python3.10-dev
python3.10-minimal
2024-07-11 06:06:12,906 INFO Writing dpkg log to /var/log/unattended-upgrades/unattended-upgrades-dpkg.log
2024-07-11 06:06:34,038 INFO All upgrades installed
2024-07-11 06:06:36,946 INFO Packages that were successfully auto-removed: dotnet-runtime-deps-8.0
2024-07-11 06:06:36,946 INFO Packages that are kept back:
2024-07-11 06:06:37,013 INFO Package dotnet-hostfxr-8.0 is kept back because a related package is kept back or due to local apt_preferences(5).
2024-07-12 06:10:02,418 INFO Starting unattended upgrades script
2024-07-12 06:10:02,419 INFO Allowed origins are: o=Ubuntu,a=jammy, o=Ubuntu,a=jammy-security, o=UbuntuESMApps,a=jammy-apps-security, o=UbuntuESM,a=jammy-infra-security
2024-07-12 06:10:02,419 INFO Initial blacklist:
2024-07-12 06:10:02,419 INFO Initial whitelist (not strict):
2024-07-12 06:10:03,279 INFO No packages found that can be upgraded unattended and no pending auto-removals
2024-07-12 06:10:03,287 INFO Package dotnet-hostfxr-8.0 is kept back because a related package is kept back or due to local apt_preferences(5).
2024-07-12 11:51:50,079 INFO Starting unattended upgrades script
2024-07-12 11:51:50,080 INFO Allowed origins are: o=Ubuntu,a=jammy, o=Ubuntu,a=jammy-security, o=UbuntuESMApps,a=jammy-apps-security, o=UbuntuESM,a=jammy-infra-security
2024-07-12 11:51:50,080 INFO Initial blacklist:
2024-07-12 11:51:50,080 INFO Initial whitelist (not strict):
2024-07-13 06:01:07,885 INFO Starting unattended upgrades script
2024-07-13 06:01:07,885 INFO Allowed origins are: o=Ubuntu,a=jammy, o=Ubuntu,a=jammy-security, o=UbuntuESMApps,a=jammy-apps-security, o=UbuntuESM,a=jammy-infra-security
2024-07-13 06:01:07,885 INFO Initial blacklist:
2024-07-13 06:01:07,885 INFO Initial whitelist (not strict):
2024-07-13 06:01:08,987 INFO Packages that will be upgraded: apache2-utils
2024-07-13 06:01:08,987 INFO Writing dpkg log to /var/log/unattended-upgrades/unattended-upgrades-dpkg.log
2024-07-13 06:01:12,376 INFO All upgrades installed
2024-07-13 06:01:12,549 INFO Package dotnet-hostfxr-8.0 is kept back because a related package is kept back or due to local apt_preferences(5).
2024-07-13 11:43:03,805 INFO Starting unattended upgrades script
2024-07-13 11:43:03,805 INFO Allowed origins are: o=Ubuntu,a=jammy, o=Ubuntu,a=jammy-security, o=UbuntuESMApps,a=jammy-apps-security, o=UbuntuESM,a=jammy-infra-security
/var/log/apt/history.log provides some additional information:
Today, after an automatic reboot for a kernel update, I woke up to find a dotnet-related unattended upgrade had clobbered one of my dotnet-powered servers:
It seems like what happened is during an automatic update, apt pulled the updated ubuntu-provided package instead of the microsoft-provided package and that left dotnet in a broken state until a manual update fixed things.
Regardless, I quickly realized the problem was the suddenly missing deps package and a simple
apt dist-upgrade
fixed it, but I thought it worth raising in case I have things misconfigured or otherwise would like to avoid having a similar issue in future.Logs
In
/var/log/unattended-upgrades/unattended-upgrades.log
I can see the problem seems to bedotnet-runtime-deps-8.0
got auto-removed for some reason. Possibly it is due todotnet-hostfxr-8.0
being kept back for some reason:/var/log/apt/history.log
provides some additional information:And to confirm the source of the package:
Possible Solution
Two things I've gone ahead and tried:
1) I've gone ahead and followed the instructions here to deprioritize the ubuntu feed for dotnet.
2) I also realize I had never added the microsoft repo to my
/etc/apt/apt.conf.d/50unattended-upgrades
, so I've also done that per this answer.If that sounds wrong or there's something else I should be doing instead, please let me know!