更新/升级不起作用(因为分阶段更新)

Dav*_*aça 35 upgrade updates command-line root mount

我尝试像往常一样进行 sudo 更新和升级,但它显示

The following packages have been kept back:
  base-files python3-distupgrade python3-gi python3-gi-cairo
  ubuntu-release-upgrader-core ubuntu-release-upgrader-gtk
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
Run Code Online (Sandbox Code Playgroud)

我试过了:

  • 正常程序(sudo apt更新和升级)
  • apt-get 过程
  • sudo -i 并执行正常程序 - https://www.youtube.com/watch?v=Il_Za-wlW5I (本视频中的内容)
  • 更改软件更新程序以及软件和更新设置

(还尝试重新启动我的笔记本电脑)

在我尝试安装 USB 和 SD 卡之前。当我尝试这个时,我当时没有网络连接。我尝试更新,当然没用。注意到并重新连接后,我确实安装了一些更新,但随后它卡在了显示器上

完整显示: sudo apt update

[sudo] password for dcg: 
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:3 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:4 http://archive.ubuntu.com/ubuntu jammy-security InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
6 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: Target Sources (restricted/source/Sources) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:7
W: Target Sources (restricted/source/Sources) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:7
dcg@dcg-IdeaPad-5-15ITL05:~$ 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:
  base-files python3-distupgrade python3-gi python3-gi-cairo
  ubuntu-release-upgrader-core ubuntu-release-upgrader-gtk
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
Run Code Online (Sandbox Code Playgroud)

更新列表:

cg@dcg-IdeaPad-5-15ITL05:~$ apt list --upgradable
Listing... Done
base-files/jammy-updates 12ubuntu4.2 amd64 [upgradable from: 12ubuntu4.1]
python3-distupgrade/jammy-updates,jammy-updates 1:22.04.12 all [upgradable from: 1:22.04.11]
python3-gi-cairo/jammy-updates 3.42.1-0ubuntu1 amd64 [upgradable from: 3.42.0-3build1]
python3-gi/jammy-updates 3.42.1-0ubuntu1 amd64 [upgradable from: 3.42.0-3build1]
ubuntu-release-upgrader-core/jammy-updates,jammy-updates 1:22.04.12 all [upgradable from: 1:22.04.11]
ubuntu-release-upgrader-gtk/jammy-updates,jammy-updates 1:22.04.12 all [upgradable from: 1:22.04.11]

dcg@dcg-IdeaPad-5-15ITL05:~$ sudo apt update
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [114 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [99,8 kB]
Get:4 http://archive.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:5 http://archive.ubuntu.com/ubuntu jammy-updates/main i386 Packages [260 kB]
Get:6 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [474 kB]
Get:7 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [196 kB]
Get:8 http://archive.ubuntu.com/ubuntu jammy-updates/universe i386 Packages [102 kB]
Fetched 1356 kB in 4s (386 kB/s)                        
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
6 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: Target Sources (restricted/source/Sources) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:7
W: Target Sources (restricted/source/Sources) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:7
dcg@dcg-IdeaPad-5-15ITL05:~$ sudo apt full-upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  base-files python3-distupgrade ubuntu-release-upgrader-core
  ubuntu-release-upgrader-gtk
The following packages will be upgraded:
  python3-gi python3-gi-cairo
2 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
Need to get 237 kB of archives.
After this operation, 1024 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 python3-gi-cairo amd64 3.42.1-0ubuntu1 [8184 B]
Get:2 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 python3-gi amd64 3.42.1-0ubuntu1 [229 kB]
Fetched 237 kB in 1s (410 kB/s)    
(Reading database ... 215354 files and directories currently installed.)
Preparing to unpack .../python3-gi-cairo_3.42.1-0ubuntu1_amd64.deb ...
Unpacking python3-gi-cairo (3.42.1-0ubuntu1) over (3.42.0-3build1) ...
Preparing to unpack .../python3-gi_3.42.1-0ubuntu1_amd64.deb ...
Unpacking python3-gi (3.42.1-0ubuntu1) over (3.42.0-3build1) ...
Setting up python3-gi (3.42.1-0ubuntu1) ...
Setting up python3-gi-cairo (3.42.1-0ubuntu1) ...
Run Code Online (Sandbox Code Playgroud)

(从这里开始只有4个包没有升级...我不知道另外2个是如何升级的)

使用 sudo apt full-update:

dcg@dcg-IdeaPad-5-15ITL05:~$ sudo apt update
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [114 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [99,8 kB]
Get:4 http://archive.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:5 http://archive.ubuntu.com/ubuntu jammy-updates/main i386 Packages [260 kB]
Get:6 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [474 kB]
Get:7 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [196 kB]
Get:8 http://archive.ubuntu.com/ubuntu jammy-updates/universe i386 Packages [102 kB]
Fetched 1356 kB in 4s (386 kB/s)                        
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
6 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: Target Sources (restricted/source/Sources) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:7
W: Target Sources (restricted/source/Sources) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:7
dcg@dcg-IdeaPad-5-15ITL05:~$ sudo apt full-upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  base-files python3-distupgrade ubuntu-release-upgrader-core
  ubuntu-release-upgrader-gtk
The following packages will be upgraded:
  python3-gi python3-gi-cairo
2 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
Need to get 237 kB of archives.
After this operation, 1024 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 python3-gi-cairo amd64 3.42.1-0ubuntu1 [8184 B]
Get:2 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 python3-gi amd64 3.42.1-0ubuntu1 [229 kB]
Fetched 237 kB in 1s (410 kB/s)    
(Reading database ... 215354 files and directories currently installed.)
Preparing to unpack .../python3-gi-cairo_3.42.1-0ubuntu1_amd64.deb ...
Unpacking python3-gi-cairo (3.42.1-0ubuntu1) over (3.42.0-3build1) ...
Preparing to unpack .../python3-gi_3.42.1-0ubuntu1_amd64.deb ...
Unpacking python3-gi (3.42.1-0ubuntu1) over (3.42.0-3build1) ...
Setting up python3-gi (3.42.1-0ubuntu1) ...
Setting up python3-gi-cairo (3.42.1-0ubuntu1) ...
Run Code Online (Sandbox Code Playgroud)

use*_*733 58

base-files, python3-distupgrade, ubuntu-release-upgrader-core, ubuntu-release-upgrader-gtk在您提出问题时,所有四个保留的软件包 ( ) 都处于分阶段更新中。

  • 分阶段更新是一种预防措施,可防止每个人通过升级收到有问题的软件包:有些人提前几天升级,其他人则晚几天升级。如果早期的人报告问题,这提供了暂停分发的机会。

没有任何错误。你的系统没有坏。

不要尝试强制升级。当轮到你的时候,Apt 会自动正确安装每个升级包。分阶段通常持续一周左右。只需运行apt updateapt upgrade在几天内再次运行即可。

  • 安全升级通常不会分阶段进行。每个人都会立即得到这些。您问题中的四个软件包是分阶段的,因此不是安全升级。

如何查看分阶段更新:

$ apt policy base-files 
base-files:
  Installed: 12ubuntu4.1
  Candidate: 12ubuntu4.2
  Version table:
     12ubuntu4.2 500 (phased 60%) <------------ There it is!
        500 http://us.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
 *** 12ubuntu4.1 100
        100 /var/lib/dpkg/status
     12ubuntu4 500
        500 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
Run Code Online (Sandbox Code Playgroud)

您还可以在https://people.canonical.com/%7Eubuntu-archive/phased-updates.html查看某些(不是全部)软件包的分阶段更新状态


如何跳过分阶段、跳到队列头部并无论如何安装新软件包:

使用 (option) 标志告诉 apt 你想要什么-o

apt -o APT::Get::Always-Include-Phased-Updates=true upgrade
Run Code Online (Sandbox Code Playgroud)
  • 对于大多数用户来说,不建议跳到队列的头部。您自愿成为测试员;以免任何错误首先影响您。更新中的错误很少见,但确实会发生。

  • 这是准确的。您可能需要添加一点,如果用户希望早于通常的分阶段接收更新,则可以运行“apt -o APT::Get::Always-Ininclude-Phased-Updates=true update”。这基本上是安全的——它只是通过绕过阶段将它们放在“队列”的前面。当然,如果事实证明该软件包是一个问题,而他们本来可以通过分阶段来避免这种情况,那么这种情况就不会发生。 (3认同)
  • 感谢您提供有关此的更多详细信息。我什至不知道 Ubuntu 中存在这种情况,因为过去的软件包通常因其他原因而被阻止。在过去的几周里,这种情况发生了很多次,以至于我认为这是一个错误或某些依赖性问题。事实上,所显示的消息在过去经常被用来表示其他含义,这会导致一些不必要的混乱。最好显示的消息会告诉您他们被阻止的原因。:) (2认同)