Ubuntu Server 22.04LTS 全新安装存在依赖冲突

Ubuntu Server 22.04LTS 全新安装存在依赖冲突

我最近安装了 ubuntu 服务器,并尝试运行更新。输出如下:

:~$ sudo apt update
Hit:1 http://us.archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:3 http://us.archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:4 http://us.archive.ubuntu.com/ubuntu jammy-security InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
76 packages can be upgraded. Run 'apt list --upgradable' to see them.

:~$ sudo apt update && sudo apt upgrade
[sudo] password for admina:
Hit:1 http://us.archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://us.archive.ubuntu.com/ubuntu jammy-updates InRelease [114 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu jammy-backports InRelease [107 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [852 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [796 kB]
Fetched 1,980 kB in 3s (777 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
76 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... 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-2ubuntu10) but 2.06-2ubuntu14 is to be installed
E: Broken packages

这可能是一个简单的修复。我搜索了一下,尝试了一些常见的修复方法,例如sudo apt-get install -f和其他一些方法,但没有任何变化。

编辑:这是请求的输出:

:~$ apt policy grub-efi-amd64-{signed,bin}
grub-efi-amd64-signed:
  Installed: 1.182~22.04.1+2.06-2ubuntu10
  Candidate: 1.187.2+2.06-2ubuntu14
  Version table:
     1.187.2+2.06-2ubuntu14 500 (phased 25%)
        500 http://us.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
 *** 1.182~22.04.1+2.06-2ubuntu10 500
        500 http://us.archive.ubuntu.com/ubuntu jammy-security/main amd64 Packages
        100 /var/lib/dpkg/status
     1.180+2.06-2ubuntu7 500
        500 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
grub-efi-amd64-bin:
  Installed: 2.06-2ubuntu10
  Candidate: 2.06-2ubuntu14
  Version table:
     2.06-2ubuntu14 500 (phased 25%)
        500 http://us.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
 *** 2.06-2ubuntu10 500
        500 http://us.archive.ubuntu.com/ubuntu jammy-security/main amd64 Packages
        100 /var/lib/dpkg/status
     2.06-2ubuntu7 500
        500 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 Packages

答案1

根据结果​​,apt policy grub-efi-amd64-{signed,bin}所涉及的软件包目前正在进行分阶段更新。在大多数情况下,它们被阻止,但由于这会导致broken packages您的 Ubuntu 出现错误,因此无论如何都可以通过运行以下命令来更新它们:

sudo apt-get install --only-upgrade `sudo apt-get upgrade | awk 'BEGIN{flag=0} /The following packages have been kept back:/ { flag=1} /^ /{if (flag) print}'`

完成后,您应该能够运行sudo apt update && sudo apt upgrade而不会收到错误消息。

相关内容