在存在“保留”依赖项的情况下,如何升级到下一个 LTS?

在存在“保留”依赖项的情况下,如何升级到下一个 LTS?

所以我想从 升级20.0422.04LTS。

Ubuntu 有一个非常烦人的事情,它会强制你安装所有升级,然后才允许你升级发行版。我已经升级过一次了,但我仍然

$ sudo do-release-upgrade 
Checking for a new Ubuntu release
Please install all available updates for your release before upgrading.

... 但,它不允许我这么做。

apt似乎知道我需要升级什么:

$ sudo apt list --upgradable 
Listing... Done
grub-efi-amd64-bin/oldstable 2.06-3~deb10u1 amd64 [upgradable from: 2.04-1ubuntu47.4]
grub-efi-amd64-signed/focal-updates,focal-updates 1.187.3~20.04.1+2.06-2ubuntu14.1 amd64 [upgradable from: 1.173.2~20.04.1+2.04-1ubuntu47.4]
libfile-fcntllock-perl/oldstable 0.22-3+b5 amd64 [upgradable from: 0.22-3build4]
libnet-libidn-perl/oldstable 0.12.ds-3+b1 amd64 [upgradable from: 0.12.ds-3build2]
python3-netifaces/oldstable 0.10.4-1+b1 amd64 [upgradable from: 0.10.4-1ubuntu4]
shim-signed/focal-updates,focal-updates 1.40.9+15.7-0ubuntu1 amd64 [upgradable from: 1.40.7+15.4-0ubuntu9]

除此之外,它实际上不会升级:

sudo apt upgrade 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
Get more security updates through Ubuntu Pro with 'esm-apps' enabled:
  libgraphicsmagick-q16-3 libavformat58 libavfilter7 ffmpeg liburiparser1
  node-hosted-git-info libmaven3-core-java libswresample3 ant libzmq5
  python2.7-minimal libhdf5-103 libcgraph6 libpython2.7 python2.7
  libswresample-dev libpostproc55 liblab-gamut1 libavutil-dev libavcodec-dev
  opensc-pkcs11 node-tar maven libeditorconfig0 opensc libcdt5 libavutil56
  libpathplan4 libavdevice58 libswscale5 libgvpr2 libopenexr24 libsdl2-2.0-0
  libmysofa1 libpython2.7-minimal libavcodec-extra58 libgvc6
  libpython2.7-stdlib graphviz ant-optional libavresample4
Learn more about Ubuntu Pro at https://ubuntu.com/pro
The following packages have been kept back:
  grub-efi-amd64-bin shim-signed
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

好的...我不知道这grub-efi-amd64-bin是什么或为什么它被“保留”。

$ sudo apt-mark showhold
$ dpkg --get-selections | grep hold

两者都没有列出任何内容。

但是我可以手动升级它吗?

$ sudo apt install grub-efi-amd64-bin
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Recommended packages:
  grub-efi-amd64-signed
The following packages will be REMOVED:
  grub-efi-amd64-signed shim-signed
The following packages will be upgraded:
  grub-efi-amd64-bin
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
  shim-signed grub-efi-amd64-signed (due to shim-signed)
1 upgraded, 0 newly installed, 2 to remove and 3 not upgraded.
Need to get 712 kB of archives.
After this operation, 7443 kB disk space will be freed.
You are about to do something potentially harmful.
To continue type in the phrase 'Yes, do as I say!'
 ?]

不,不这么做。^C

但也许是那个-signed东西会升级shim-signed而不是删除它?

$ sudo apt --only-upgrade install grub-efi-amd64-signed
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 grub-efi-amd64-signed : Depends: grub-efi-amd64-bin (= 2.06-2ubuntu14.1)
E: Unable to correct problems, you have held broken packages.

这个问题的一个小变化之前曾被问过:

Ubuntu 22.04LTS 中的 grub-efi-amd64-signed 依赖问题

ruff 的回答是安装grub-efi-amd64-signed...我们刚刚尝试过,但它不起作用。

Chen 的另一个回答,这表明

sudo rm /var/lib/dpkg/info/grub*
sudo dpkg --configure -a

但我现在不会这么做,因为我完全不知道这样做会有什么用处,而且https://ubuntuforums.org/showthread.php?t=1041188

现在无法纠正问题,您持有破损的包裹建议

$ sudo aptitude install grub-efi-amd64-signed
The following packages will be REMOVED:  
  efibootmgr{u} grub-efi-amd64-bin{u} 
The following packages will be upgraded:
  grub-efi-amd64-signed{b} 
1 packages upgraded, 0 newly installed, 2 to remove and 4 not upgraded.
Need to get 1343 kB of archives. After unpacking 5352 kB will be freed.
The following packages have unmet dependencies:
 grub-efi-amd64-signed : Depends: grub-efi-amd64-bin (= 2.06-2ubuntu14.1) but it is not going to be installed
The following actions will resolve these dependencies:

     Install the following packages:                                                                  
1)     efibootmgr:i386 [15-1 (oldstable)]                                                             
2)     libefiboot1:i386 [37-2+deb10u1 (oldstable)]                                                    
3)     libefivar1:i386 [37-2+deb10u1 (oldstable)]                                                     
4)     libpopt0:i386 [1.16-14 (focal)]                                                                

     Upgrade the following packages:                                                                  
5)     grub-efi-amd64-bin [2.04-1ubuntu47.4 (focal-security, now) -> 2.06-2ubuntu14.1 (focal-updates)]



Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:

     Upgrade the following packages:                                                                  
1)     grub-efi-amd64-bin [2.04-1ubuntu47.4 (focal-security, now) -> 2.06-2ubuntu14.1 (focal-updates)]

     Leave the following dependencies unresolved:                                                     
2)     grub-efi-amd64-bin recommends efibootmgr                                                       



Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:

     Upgrade the following packages:                                                                  
1)     grub-efi-amd64-bin [2.04-1ubuntu47.4 (focal-security, now) -> 2.06-2ubuntu14.1 (focal-updates)]

     Downgrade the following packages:                                                                
2)     efibootmgr [17-1 (focal, now) -> 15-1 (oldstable)]                                             



Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:

     Keep the following packages at their current version:                                            
1)     efibootmgr [17-1 (focal, now)]                                                                 

     Upgrade the following packages:                                                                  
2)     grub-efi-amd64-bin [2.04-1ubuntu47.4 (focal-security, now) -> 2.06-2ubuntu14.1 (focal-updates)]

我确实很佩服aptitude的毅力,因为此后出现的疯狂建议越来越多。

我的问题是,我不知道如何选择一个好的选项。最后一个听起来对我更有吸引力,但我知道什么呢?

我也不知道删除或更新这些软件包会有什么后果。磁盘已加密,我非常不希望在尝试升级时弄坏我的设备。

我该如何升级该操作系统?

答案1

这两个被保留的软件包目前正在进行分阶段升级。参见https://ubuntu-archive-team.ubuntu.com/phased-updates.html

您还可以通过运行apt policy <package_name>每个保留的包来验证这一点。

您有两个选择:

  1. 您只需等待分阶段完成即可,通常需要几天时间。这是一个好主意,因为您的 Frankensystem 需要返回到 Ubuntu 系统,否则您的发布升级可能会失败。

  2. 另外,您可以使用 强制升级sudo apt -o APT::Get::Always-Include-Phased-Updates=true upgrade。这只会跳过阶段并安装软件包;它不会修复系统的其他问题。

相关内容