无法从 21.10 升级到 22.04,因为某些软件包被保留了下来

无法从 21.10 升级到 22.04,因为某些软件包被保留了下来

我正在尝试从 Ubuntu 21.10 升级到 Ubuntu 22.04。升级到 22.04 的通知也自动出现。但是升级没有成功。

尝试使用终端升级到 LTS 版本时,会打印以下消息

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

打印sudo apt upgrade以下消息:

 The following packages have been kept back:
      cups cups-bsd cups-client cups-core-drivers cups-daemon cups-ipp-utils dirmngr ffmpeg gir1.2-javascriptcoregtk-4.0 gir1.2-webkit2-4.0 gnome-control-center gnome-control-center-data gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm gpgv ldap-utils libavcodec58 libavdevice58 libavfilter7 libavformat58 libavutil56 libcups2 libcupsimage2 libcurl3-gnutls libfreerdp2-2 libinput-bin libinput10 libjavascriptcoregtk-4.0-18 libldap-2.5-0 libpostproc55 libswresample3 libswscale5 libwebkit2gtk-4.0-37 libwinpr2-2 libxml2 ntfs-3g xserver-xephyr xserver-xorg-core xvfb xwayland
0 upgraded, 0 newly installed, 0 to remove and 47 not upgraded.

当尝试手动更新或安装上述任何一个包时,它只会打印一长串依赖错误。

我不知道如何解决这个问题。这个问题在这里已经被问过很多次了,AskUbuntu但是建议的解决方案对我来说都不起作用。

有什么方法可以抑制这些软件包中的错误并继续升级到 Ubuntu 22.04?

更新

的输出sudo apt update如下:

Hit:1 http://dl.google.com/linux/chrome/deb stable InRelease                                         
Hit:2 http://security.ubuntu.com/ubuntu jammy-security InRelease                                     
Hit:3 https://updates.signal.org/desktop/apt xenial InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
47 packages can be upgraded. Run 'apt list --upgradable' to see them.

的输出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:
  cups cups-bsd cups-client cups-core-drivers cups-daemon cups-ipp-utils dirmngr ffmpeg gir1.2-javascriptcoregtk-4.0
  gir1.2-webkit2-4.0 gnome-control-center gnome-control-center-data gnupg gnupg-l10n gnupg-utils gpg gpg-agent
  gpg-wks-client gpg-wks-server gpgconf gpgsm gpgv ldap-utils libavcodec58 libavdevice58 libavfilter7 libavformat58
  libavutil56 libcups2 libcupsimage2 libcurl3-gnutls libfreerdp2-2 libinput-bin libinput10 libjavascriptcoregtk-4.0-18
  libldap-2.5-0 libpostproc55 libswresample3 libswscale5 libwebkit2gtk-4.0-37 libwinpr2-2 libxml2 ntfs-3g xserver-xephyr
  xserver-xorg-core xvfb xwayland
0 upgraded, 0 newly installed, 0 to remove and 47 not upgraded.

外部 PPA 列表如下:

ppa:costales/yaru-colors-folder-color
ppa:linuxuprising/apps
ppa:numix/ppa
ppa:team-xbmc/ppa
ppa:kelebek333/mint-tools

的输出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:
  cups cups-bsd cups-client cups-core-drivers cups-daemon cups-ipp-utils dirmngr
  gir1.2-javascriptcoregtk-4.0 gir1.2-webkit2-4.0 gnome-control-center gnome-control-center-data
  gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm gpgv
  ldap-utils libavcodec58 libavformat58 libavutil56 libcups2 libcupsimage2 libcurl3-gnutls
  libfreerdp2-2 libinput-bin libinput10 libjavascriptcoregtk-4.0-18 libldap-2.5-0 libpostproc55
  libswresample3 libswscale5 libwebkit2gtk-4.0-37 libwinpr2-2 libxml2 ntfs-3g xserver-xephyr
  xserver-xorg-core xvfb xwayland
0 upgraded, 0 newly installed, 0 to remove and 44 not upgraded.

更新(2022 年 7 月 18 日)

的输出apt-cache policy cups如下:

cups:
  Installed: 2.3.3op2-7ubuntu2
  Candidate: 2.4.1op1-1ubuntu4.1
  Version table:
     2.4.1op1-1ubuntu4.1 500
        500 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages
 *** 2.3.3op2-7ubuntu2 100
        100 /var/lib/dpkg/status

输出apt-cache policy cups cups-daemon libcups2如下:

cups:
  Installed: 2.3.3op2-7ubuntu2
  Candidate: 2.4.1op1-1ubuntu4.1
  Version table:
     2.4.1op1-1ubuntu4.1 500
        500 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages
 *** 2.3.3op2-7ubuntu2 100
        100 /var/lib/dpkg/status
cups-daemon:
  Installed: 2.3.3op2-7ubuntu2
  Candidate: 2.4.1op1-1ubuntu4.1
  Version table:
     2.4.1op1-1ubuntu4.1 500
        500 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages
 *** 2.3.3op2-7ubuntu2 100
        100 /var/lib/dpkg/status
libcups2:
  Installed: 2.3.3op2-7ubuntu2
  Candidate: 2.4.1op1-1ubuntu4.1
  Version table:
     2.4.1op1-1ubuntu4.1 500
        500 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages
 *** 2.3.3op2-7ubuntu2 100
        100 /var/lib/dpkg/status

输出sudo apt upgrade cups如下:

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:
 cups : Depends: cups-client (>= 2.4.1op1-1ubuntu4.1)
        Depends: cups-daemon (>= 2.4.1op1-1ubuntu4.1)
        Depends: libcups2 (= 2.4.1op1-1ubuntu4.1) but 2.3.3op2-7ubuntu2 is to be installed
 cups-core-drivers : Depends: cups-daemon (>= 2.4.1op1-1ubuntu4.1)
                     Depends: libcups2 (= 2.4.1op1-1ubuntu4.1) but 2.3.3op2-7ubuntu2 is to be installed
E: Broken packages

输出apt-cache policy如下:

Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 https://updates.signal.org/desktop/apt xenial/main amd64 Packages
     release o=. xenial,a=xenial,n=xenial,l=. xenial,c=main,b=amd64
     origin updates.signal.org
 500 http://dl.google.com/linux/chrome/deb stable/main amd64 Packages
     release v=1.0,o=Google LLC,a=stable,n=stable,l=Google,c=main,b=amd64
     origin dl.google.com
 500 http://security.ubuntu.com/ubuntu jammy-security/multiverse i386 Packages
     release v=22.04,o=Ubuntu,a=jammy-security,n=jammy,l=Ubuntu,c=multiverse,b=i386
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages
     release v=22.04,o=Ubuntu,a=jammy-security,n=jammy,l=Ubuntu,c=multiverse,b=amd64
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu jammy-security/universe i386 Packages
     release v=22.04,o=Ubuntu,a=jammy-security,n=jammy,l=Ubuntu,c=universe,b=i386
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages
     release v=22.04,o=Ubuntu,a=jammy-security,n=jammy,l=Ubuntu,c=universe,b=amd64
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu jammy-security/restricted i386 Packages
     release v=22.04,o=Ubuntu,a=jammy-security,n=jammy,l=Ubuntu,c=restricted,b=i386
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages
     release v=22.04,o=Ubuntu,a=jammy-security,n=jammy,l=Ubuntu,c=restricted,b=amd64
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu jammy-security/main i386 Packages
     release v=22.04,o=Ubuntu,a=jammy-security,n=jammy,l=Ubuntu,c=main,b=i386
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages
     release v=22.04,o=Ubuntu,a=jammy-security,n=jammy,l=Ubuntu,c=main,b=amd64
     origin security.ubuntu.com
Pinned packages:

答案1

请备份您的个人数据并确保您拥有 jammy 的安装媒体以防万一。

在 /etc/apt/sources.list 中添加 jammy 更新源。

sudo nano /etc/apt/sources.list 

并添加行

deb http://archive.ubuntu.com/ubuntu jammy-updates main restricted multiverse universe

然后刷新

sudo apt update && apt -s -f install

第二部分只是模拟。如果 apt 和 dpkg 都没有报错。

sudo apt -f install && sudo apt full-upgrade

相关内容