我遇到了 apt 返回的错误,经过许多故障排除步骤后,我找不到原因或解决方案。以下是apt update
输出:
$ sudo apt update
Hit:1 https://nvidia.github.io/libnvidia-container/stable/deb/amd64 InRelease
Hit:2 https://download.docker.com/linux/ubuntu jammy InRelease
Hit:3 https://debian.neo4j.com stable InRelease
Hit:4 http://repository.netdata.cloud/repos/stable/ubuntu jammy/ InRelease
Hit:5 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:6 http://ca.archive.ubuntu.com/ubuntu jammy InRelease
Get:7 https://esm.ubuntu.com/apps/ubuntu jammy-apps-security InRelease [7,568 B]
Hit:8 http://ca.archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:9 http://repository.netdata.cloud/repos/repoconfig/ubuntu jammy/ InRelease
Get:10 https://esm.ubuntu.com/apps/ubuntu jammy-apps-updates InRelease [7,456 B]
Hit:11 http://ca.archive.ubuntu.com/ubuntu jammy-backports InRelease
Get:12 https://esm.ubuntu.com/infra/ubuntu jammy-infra-security InRelease [7,450 B]
Get:13 https://esm.ubuntu.com/infra/ubuntu jammy-infra-updates InRelease [7,449 B]
Hit:14 https://ppa.launchpadcontent.net/linrunner/tlp/ubuntu jammy InRelease
Fetched 29.9 kB in 1s (20.1 kB/s)
Reading package lists... Done
E: No priority (or zero) specified for pin
该错误表明缺少引脚优先级。我查看了/etc/apt/preferences.d/
。有 3 个文件,并且所有文件都已分配引脚优先级:
$ ll /etc/apt/preferences.d/
total 12K
-rw-r--r-- 1 root root 65 Mar 5 06:20 80netdata
-rw-r--r-- 1 root root 437 Feb 14 2024 ubuntu-pro-esm-apps
-rw-r--r-- 1 root root 429 Feb 14 2024 ubuntu-pro-esm-infra
$ cat /etc/apt/preferences.d/*
Package: *
Pin: origin "repository.netdata.cloud"
Priority: 1000
# This file is used by Ubuntu Pro and supplied by the ubuntu-pro-client
# package. It has no effect if Ubuntu Pro services are not in use since no
# other apt repositories are expected to match o=UbuntuESMApps.
#
# Pin esm-apps packages to a slightly higher value than the default,
# so those are preferred over a non-ESM package from the archive when the
# service is enabled.
Package: *
Pin: release o=UbuntuESMApps
Pin-Priority: 510
# This file is used by Ubuntu Pro and supplied by the ubuntu-pro-client
# package. It has no effect if Ubuntu Pro services are not in use since no
# other apt repositories are expected to match o=UbuntuESM.
#
# Pin esm-infra packages to a slightly higher value than the default,
# so those are preferred over a non-ESM package from the archive when the
# service is enabled.
Package: *
Pin: release o=UbuntuESM
Pin-Priority: 510
至少 3 个月以来,apt 设置方面没有任何变化,最近唯一值得注意的是我apt update & apt upgrade
前一天所做的事情。
我完全不知所措。如果有任何解决方案,我将不胜感激。
只需提供一个答案,您就可以将其勾选为已批准,希望这可以帮助其他人:)
正如@Flyrobot27 指出的,只需编辑
/etc/apt/preferences.d/80netdata
并更改该行:到: