AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1543006
Accepted
Flyrobot27
Flyrobot27
Asked: 2025-03-06 08:54:47 +0800 CST2025-03-06 08:54:47 +0800 CST 2025-03-06 08:54:47 +0800 CST

apt 突然崩溃,错误 No priority (or zero) specified for pin

  • 772

我遇到了 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前一天所做的事情。

我完全不知所措。如果有任何解决方案,我将不胜感激。

apt
  • 1 1 个回答
  • 266 Views

1 个回答

  • Voted
  1. Best Answer
    Brendon Muir
    2025-03-07T03:59:47+08:002025-03-07T03:59:47+08:00

    只需提供一个答案,您就可以将其勾选为已批准,希望这可以帮助其他人:)

    正如@Flyrobot27 指出的,只需编辑/etc/apt/preferences.d/80netdata并更改该行:

    Priority: 1000
    

    到:

    Pin-Priority: 1000
    
    • 7

相关问题

  • 如何编写 shell 脚本来安装应用程序列表?

  • 如何查看存档中可用的软件包的所有版本?

  • 是否可以说出我安装的哪些软件包不在原版安装中?

  • 如何删除 PPA?

  • 使用 apt-get upgrade 时如何强制安装内核更新?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve