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

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

我尝试像往常一样执行 sudo update 和 upgrade,但它显示

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.

我试过了:

  • 正常程序(sudo apt update 和 upgrade)
  • 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.

更新列表:

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) ...

(从现在开始只有 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) ...

答案1

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

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


如何跳过阶段,跳至队列头部,并安装新包:

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

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

答案2

如果您希望将来永久选择加入所有分阶段的升级,您可以创建一个 conf 文件,这样您不必在每次发出时添加长命令选项apt upgrade

/etc/apt/apt.conf.d/30phased-upgrades

APT::Get::Always-Include-Phased-Updates "true";

答案3

我遇到了类似的问题,并通过安装 aptitude 包并运行以下命令解决了该问题。

$ sudo aptitude update
$ sudo aptitude upgrade

看到一些答案后,我现在不知道是否做错了并得到了那个有缺陷的包,但我的电脑现在运行正常,我再也没有遇到过同样的问题。

相关内容