我正在尝试在 ubuntu 20.04.2 上为 microsoft dotnet 配置无人值守升级。
我在无人值守升级配置中将来源和部分添加到允许来源:
Unattended-Upgrade::Allowed-Origins {
"${distro_id}:${distro_codename}";
"${distro_id}:${distro_codename}-security";
"${distro_id}ESMApps:${distro_codename}-apps-security";
"${distro_id}ESM:${distro_codename}-infra-security";
"${distro_id}:${distro_codename}-updates";
// "${distro_id}:${distro_codename}-proposed";
// "${distro_id}:${distro_codename}-backports";
"microsoft-ubuntu-focal-prod:focal";
};
...并且根据 apt list --upgradeable 的报告,有一些 dotnet 升级正在等待:
aspnetcore-runtime-5.0/focal 5.0.7-1 amd64 [upgradable from: 5.0.6-1]
dotnet-host/focal 5.0.7-1 amd64 [upgradable from: 5.0.6-1]
dotnet-hostfxr-5.0/focal 5.0.7-1 amd64 [upgradable from: 5.0.6-1]
dotnet-runtime-5.0/focal 5.0.7-1 amd64 [upgradable from: 5.0.6-1]
dotnet-runtime-deps-5.0/focal 5.0.7-1 amd64 [upgradable from: 5.0.6-1]
...但是当我运行 sudo unattended-upgrades --dry-run --debug 时,我得到:
Checking: aspnetcore-runtime-5.0 ([<Origin component:'main' archive:'focal' origin:'microsoft-ubuntu-focal-prod focal' label:'microsoft-ubuntu-focal-prod focal' site:'packages.microsoft.com' isTrusted:True>])
adjusting candidate version: aspnetcore-runtime-5.0=5.0.6-1
Checking: dotnet-host ([<Origin component:'main' archive:'focal' origin:'microsoft-ubuntu-focal-prod focal' label:'microsoft-ubuntu-focal-prod focal' site:'packages.microsoft.com' isTrusted:True>])
adjusting candidate version: dotnet-host=5.0.6-1
Checking: dotnet-hostfxr-5.0 ([<Origin component:'main' archive:'focal' origin:'microsoft-ubuntu-focal-prod focal' label:'microsoft-ubuntu-focal-prod focal' site:'packages.microsoft.com' isTrusted:True>])
adjusting candidate version: dotnet-hostfxr-5.0=5.0.6-1
Checking: dotnet-runtime-5.0 ([<Origin component:'main' archive:'focal' origin:'microsoft-ubuntu-focal-prod focal' label:'microsoft-ubuntu-focal-prod focal' site:'packages.microsoft.com' isTrusted:True>])
adjusting candidate version: dotnet-runtime-5.0=5.0.6-1
Checking: dotnet-runtime-deps-5.0 ([<Origin component:'main' archive:'focal' origin:'microsoft-ubuntu-focal-prod focal' label:'microsoft-ubuntu-focal-prod focal' site:'packages.microsoft.com' isTrusted:True>])
adjusting candidate version: dotnet-runtime-deps-5.0=5.0.6-1
pkgs that look like they should be upgraded:
Fetched 0 B in 0s (0 B/s)
fetch.run() result: 0
Packages blacklist due to conffile prompts: []
No packages found that can be upgraded unattended and no pending auto-removals
The list of kept packages can't be calculated in dry-run mode.
知道问题是什么吗?为什么 5x dotnet 包没有升级?
提前致谢!
答案1
“origin” 的语法也包括发布代号,如下输出所示unattended-upgrades --dry-run --debug
:
检查:dotnet-hostfxr-6.0([<Origin component:'main' archive:'bionic' origin:'microsoft-ubuntu-bionic-prod仿生的' 标签:'microsoft-ubuntu-bionic-prod bionic' 站点:'packages.microsoft.com' isTrusted:True>])
(在我的情况下是“bionic”而不是“focal”)。因此,Unattended-Upgrade::Allowed-Origins
您需要的是“microsoft-ubuntu-focal-prod”,而不是“microsoft-ubuntu-focal-prod :focal”焦点:焦点”
这应该使它与版本无关:
"microsoft-ubuntu-${distro_codename}-prod ${distro_codename}:${distro_codename}";