包裹不断被扣留

包裹不断被扣留

最近,当我去更新我的 Ubuntu 22.04 机器时,我经常看到软件包似乎毫无理由地被阻止。以下是最新情况:

Earth:sudo apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  gnome-control-center gnome-control-center-data gnome-control-center-faces
  libapache2-mod-php8.1 php8.1 php8.1-cgi php8.1-cli php8.1-common
  php8.1-mysql php8.1-opcache php8.1-readline
0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded.
Earth:

如果我使用 apt upgrade 并指定软件包,安装将顺利进行。但为什么会出现这些阻碍?

答案1

它们被称为分阶段更新。“APT 现在实施分阶段更新。以前,只有更新管理器实施分阶段更新,而且只用于台式机 - APT 中的实施意味着它也适用于服务器、树莓派和容器。这意味着在分阶段更新期间,某些更新将在某些机器上被阻止。”https://discourse.ubuntu.com/t/phased-updates-in-apt-in-21-04/20345

答案2

奇怪的是,这最终成为了答案。没有立即显现出来的是创建 /etc/apt/apt.conf.d/20phased-updates 时使用:

// To have all your machines phase the same, set the same string in this field
// If commented out, apt will use /etc/machine-id to seed the random number generator
APT::Machine-ID "aaaabbbbccccddddeeeeffff";

// Always include phased updates (Default = 1)
APT::Get::Always-Include-Phased-Updates "1"; 

// Never include phased updates
# APT::Get::Never-Include-Phased-Updates "0";

相关内容