从 23.04 升级到 23.10 时出现的问题

从 23.04 升级到 23.10 时出现的问题

我尝试在从 22.04 LTS 升级后立即从 23.04 升级到 23.10。升级过程中,我收到此错误:

无法计算升舱

[...]
这可能是由以下原因造成的:
* Ubuntu 未提供的非官方软件包。
[...]

错误对话框如下所示(图片来自这篇 Reddit 帖子):

错误截图

我进行了调查/var/log/dist-upgrade/main.log并发现:

WARNING Can't mark 'ubuntu-desktop' for upgrade(E:Unable to correct problems, you have held broken packages.)

所以我运行了这个:

apt-mark showhold

我已经运行了sudo apt update ; sudo apt install ubuntu-desktop^,它安装了很多东西。但之后症状相同。

我也尝试过以下命令:

$ sudo sed -i 's/lunar/mantic/g' /etc/apt/sources.list
$ sudo apt update && sudo apt dist-upgrade
...
The following packages have unmet dependencies:
 gnome-remote-desktop : Depends: libmutter-12-0 (>= 44~) but it is not going to be installed
 gnome-shell : Depends: gir1.2-mutter-12 (>= 44.2) but it is not going to be installed
               Depends: libmutter-12-0 (>= 44.2) but it is not going to be installed
E: Broken packages

以下是一些有用的输出:

  • 输出apt-cache policy ubuntu-desktop

    ubuntu-desktop:
      Installed: 1.501
      Candidate: 1.501
     *** 1.501 500
            500 http://se.archive.ubuntu.com/ubuntu lunar/main amd64 Packages
            100 /var/lib/dpkg/status 
    
  • 输出apt-cache policy gnome-remote-desktop libmutter-12-0 gnome-shell gir1.2-mutter-12 libmutter-12-0

    gnome-remote-desktop:
      Installed: 44.2-0ubuntu1
      Candidate: 45.0-1
      Version table:
         45.0-1 500
            500 http://se.archive.ubuntu.com/ubuntu mantic/main amd64 Packages
     *** 44.2-0ubuntu1 100
            100 /var/lib/dpkg/status
    libmutter-12-0:
      Installed: 44.3-0ubuntu1.1
      Candidate: 44.3-0ubuntu1.1
      Version table:
     *** 44.3-0ubuntu1.1 100
            100 /var/lib/dpkg/status
    gnome-shell:
      Installed: 44.3-0ubuntu1.1
      Candidate: 45.1-0ubuntu1
      Version table:
         45.1-0ubuntu1 500
            500 http://se.archive.ubuntu.com/ubuntu mantic-updates/main amd64 Packages
         45.0-1ubuntu2 500
            500 http://se.archive.ubuntu.com/ubuntu mantic/main amd64 Packages
     *** 44.3-0ubuntu1.1 100
            100 /var/lib/dpkg/status
    gir1.2-mutter-12:
      Installed: 44.3-0ubuntu1.1
      Candidate: 44.3-0ubuntu1.1
      Version table:
     *** 44.3-0ubuntu1.1 100
            100 /var/lib/dpkg/status
    libmutter-12-0:
      Installed: 44.3-0ubuntu1.1
      Candidate: 44.3-0ubuntu1.1
      Version table:
     *** 44.3-0ubuntu1.1 100
            100 /var/lib/dpkg/status
    
  • 输出grep ^deb /etc/apt/sources.list.d/*

    /etc/apt/sources.list.d/1password.list:deb [arch=amd64 signed-by=/usr/share/keyrings/1password-archive-keyring.gpg] https://downloads.1password.com/linux/debian/amd64 stable main
    /etc/apt/sources.list.d/1password.list.distUpgrade:deb [arch=amd64 signed-by=/usr/share/keyrings/1password-archive-keyring.gpg] https://downloads.1password.com/linux/debian/amd64 stable main
    /etc/apt/sources.list.d/1password.list.save:deb [arch=amd64 signed-by=/usr/share/keyrings/1password-archive-keyring.gpg] https://downloads.1password.com/linux/debian/amd64 stable main
    /etc/apt/sources.list.d/brave-browser-release.list:deb [arch=amd64 signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main
    /etc/apt/sources.list.d/brave-browser-release.list.distUpgrade:deb [arch=amd64 signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main
    /etc/apt/sources.list.d/brave-browser-release.list.save:deb [arch=amd64 signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main
    /etc/apt/sources.list.d/docker.list:deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu   jammy stable
    /etc/apt/sources.list.d/docker.list.distUpgrade:deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu   jammy stable
    /etc/apt/sources.list.d/docker.list.save:deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu   jammy stable
    /etc/apt/sources.list.d/mozillateam-ubuntu-ppa-jammy.list.save:deb https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu/ lunar main # disabled on upgrade to lunar
    
  • 输出grep ^deb /etc/apt/sources.list

    deb http://se.archive.ubuntu.com/ubuntu/ mantic main restricted
    deb http://se.archive.ubuntu.com/ubuntu/ mantic-updates main restricted
    deb http://se.archive.ubuntu.com/ubuntu/ mantic universe
    deb http://se.archive.ubuntu.com/ubuntu/ mantic-updates universe
    deb http://se.archive.ubuntu.com/ubuntu/ mantic multiverse
    deb http://se.archive.ubuntu.com/ubuntu/ mantic-updates multiverse
    deb http://se.archive.ubuntu.com/ubuntu/ mantic-backports main restricted universe multiverse
    deb http://security.ubuntu.com/ubuntu mantic-security main restricted
    deb http://security.ubuntu.com/ubuntu mantic-security universe
    deb http://security.ubuntu.com/ubuntu mantic-security multiverse
    

我感觉我迷失了方向。下一步该怎么做?

答案1

我怀疑(如屏幕截图所示)你启用了一些 PPA,导致进程受阻。找出原因的一个粗暴方法是编辑/etc/apt/sources.list替换lunarmanticthen sudo apt update ; sudo apt dist-upgrade,但说“y”进行升级。然后查看您遇到什么错误。将这些错误粘贴到问题中。

此时,您可以恢复该sources.list文件并执行另一次apt update返回操作,假设您没有升级任何软件包。

这也是可能的以这种方式真正完成完整版本升级。但这可能会失败,因为飞行前检查显示update-managerdo-release-upgrade表明它不会起作用。

它可能会导致您的桌面无法运行 - 例如启动时出现黑屏而没有桌面。

就我个人而言,我会使用 强制升级sudo apt dist-upgrade,如果任何软件包失败,根据您看到的消息,我会强制安装特定的软件包,例如sudo apt install gnome-shell gnome-remote-desktop

它可能需要sudo apt dist-upgrade第二次运行,甚至sudo apt install ubuntu-desktop^。我不会重新启动,直到您可以对 apt 感到满意dist-upgrade并安装ubuntu-desktop^。但这是您的系统。您可能想等待更好的答案 :)

相关内容