Debian 10 dpkg/apt 降级错误

Debian 10 dpkg/apt 降级错误

Linux菜鸟在这里:

我试图安装较新版本的 AMD Mesa 以帮助进行游戏和视频编辑。 Buster 存储库似乎只有 18.x 版本。我尝试使用 Sid 存储库中的软件包,但在使用 apt -f install 时不断降级。我从 debian.org 下载了 Mesa 20 所需的所有 .deb 文件,并使用 dpkg -i 安装它们(根据 DontBreakDebian,这是一个坏主意)。我正在尝试将手动安装的所有软件包降级回 Buster 使用的版本。

以 Inkscape 为例(已安装):

root@CBTS-WBPC5:/home/cbts/Downloads# apt install inkscape
Reading package lists... Done
Building dependency tree       
Reading state information... Done
inkscape is already the newest version (0.92.4-3).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 i965-va-driver:i386 : Depends: libdrm2:i386 (>= 2.3.1) but it is not going to be installed
 libavutil56:i386 : Depends: libdrm2:i386 (>= 2.3.1) but it is not going to be installed
 libbsd0 : Breaks: libbsd0:i386 (!= 0.11.3-1) but 0.9.1-2+deb10u1 is to be installed
 libbsd0:i386 : Breaks: libbsd0 (!= 0.9.1-2+deb10u1) but 0.11.3-1 is to be installed
 libdrm-intel1:i386 : Depends: libdrm2:i386 (>= 2.4.38) but it is not going to be installed
 libdw1 : Depends: libelf1 (= 0.176-1.1) but 0.183-3 is to be installed
 libedit2 : Breaks: libedit2:i386 (!= 3.1-20191231-2+b1) but 3.1-20181209-1 is to be installed
 libedit2:i386 : Breaks: libedit2 (!= 3.1-20181209-1) but 3.1-20191231-2+b1 is to be installed
 libelf-dev : Depends: libelf1 (= 0.176-1.1) but 0.183-3 is to be installed
 libelf1 : Breaks: libelf1:i386 (!= 0.183-3) but 0.176-1.1 is to be installed
 libelf1:i386 : Breaks: libelf1 (!= 0.176-1.1) but 0.183-3 is to be installed
 libexpat1 : Breaks: libexpat1:i386 (!= 2.2.10-2) but 2.2.6-2+deb10u1 is to be installed
 libexpat1:i386 : Breaks: libexpat1 (!= 2.2.6-2+deb10u1) but 2.2.10-2 is to be installed
 libexpat1-dev : Depends: libexpat1 (= 2.2.6-2+deb10u1) but 2.2.10-2 is to be installed
 libncurses-dev : Depends: libtinfo6 (= 6.1+20181013-2+deb10u2) but 6.2+20201114-2 is to be installed
                  Depends: libncurses6 (= 6.1+20181013-2+deb10u2) but 6.2+20201114-2 is to be installed
 libncurses6 : Breaks: libncurses6:i386 (!= 6.2+20201114-2) but 6.1+20181013-2+deb10u2 is to be installed
 libncurses6:i386 : Breaks: libncurses6 (!= 6.1+20181013-2+deb10u2) but 6.2+20201114-2 is to be installed
 libncursesw6 : Depends: libtinfo6 (= 6.1+20181013-2+deb10u2) but 6.2+20201114-2 is to be installed
 libstdc++6 : Breaks: libstdc++6:i386 (!= 10.2.1-6) but 8.3.0-6 is to be installed
 libstdc++6:i386 : Breaks: libstdc++6 (!= 8.3.0-6) but 10.2.1-6 is to be installed
 libtinfo-dev : Depends: libtinfo6 (= 6.1+20181013-2+deb10u2) but 6.2+20201114-2 is to be installed
 libtinfo6 : Breaks: libtinfo6:i386 (!= 6.2+20201114-2) but 6.1+20181013-2+deb10u2 is to be installed
 libtinfo6:i386 : Breaks: libtinfo6 (!= 6.1+20181013-2+deb10u2) but 6.2+20201114-2 is to be installed
 libva-drm2:i386 : Depends: libdrm2:i386 (>= 2.4.16) but it is not going to be installed
 libva-x11-2:i386 : Depends: libdrm2:i386 (>= 2.3.1) but it is not going to be installed
 libvulkan-dev : Depends: libvulkan1 (= 1.1.97-2) but 1.2.162.0-1 is to be installed
 libvulkan1 : Depends: libc6 (>= 2.29) but 2.28-10 is to be installed
              Breaks: libvulkan1:i386 (!= 1.2.162.0-1) but 1.1.97-2 is to be installed
 libvulkan1:i386 : Breaks: libvulkan1 (!= 1.1.97-2) but 1.2.162.0-1 is to be installed
 libwayland-client0 : Breaks: libwayland-client0:i386 (!= 1.19.0-2) but 1.16.0-1 is to be installed
 libwayland-client0:i386 : Breaks: libwayland-client0 (!= 1.16.0-1) but 1.19.0-2 is to be installed
 libwayland-dev : Depends: libwayland-client0 (= 1.16.0-1) but 1.19.0-2 is to be installed
 libx11-6 : Breaks: libx11-6:i386 (!= 2:1.7.0-2) but 2:1.6.7-1+deb10u1 is to be installed
 libx11-6:i386 : Breaks: libx11-6 (!= 2:1.6.7-1+deb10u1) but 2:1.7.0-2 is to be installed
 libx11-dev : Depends: libx11-6 (= 2:1.6.7-1+deb10u1) but 2:1.7.0-2 is to be installed
 libx11-xcb-dev : Depends: libx11-xcb1 (= 2:1.6.7-1+deb10u1) but 2:1.7.0-2 is to be installed
 libx11-xcb1 : Breaks: libx11-xcb1:i386 (!= 2:1.7.0-2) but 2:1.6.7-1+deb10u1 is to be installed
 libx11-xcb1:i386 : Breaks: libx11-xcb1 (!= 2:1.6.7-1+deb10u1) but 2:1.7.0-2 is to be installed
 libxau-dev : Depends: libxau6 (= 1:1.0.8-1+b2) but 1:1.0.9-1 is to be installed
 libxau6 : Breaks: libxau6:i386 (!= 1:1.0.9-1) but 1:1.0.8-1+b2 is to be installed
 libxau6:i386 : Breaks: libxau6 (!= 1:1.0.8-1+b2) but 1:1.0.9-1 is to be installed
 libxcb-dri3-0 : Breaks: libxcb-dri3-0:i386 (!= 1.14-3) but 1.13.1-2 is to be installed
 libxcb-dri3-0:i386 : Breaks: libxcb-dri3-0 (!= 1.13.1-2) but 1.14-3 is to be installed
 libxcb-dri3-dev : Depends: libxcb-dri3-0 (= 1.13.1-2) but 1.14-3 is to be installed
 libxcb-present-dev : Depends: libxcb-present0 (= 1.13.1-2) but 1.14-3 is to be installed
 libxcb-present0 : Breaks: libxcb-present0:i386 (!= 1.14-3) but 1.13.1-2 is to be installed
 libxcb-present0:i386 : Breaks: libxcb-present0 (!= 1.13.1-2) but 1.14-3 is to be installed
 libxcb-randr0-dev : Depends: libxcb-randr0 (= 1.13.1-2) but 1.14-3 is to be installed
 libxcb-sync-dev : Depends: libxcb-sync1 (= 1.13.1-2) but 1.14-3 is to be installed
 libxcb-sync1 : Breaks: libxcb-sync1:i386 (!= 1.14-3) but 1.13.1-2 is to be installed
 libxcb-sync1:i386 : Breaks: libxcb-sync1 (!= 1.13.1-2) but 1.14-3 is to be installed
 libzstd1 : Breaks: libzstd1:i386 (!= 1.4.8+dfsg-2.1) but 1.3.8+dfsg-3+deb10u2 is to be installed
 libzstd1:i386 : Breaks: libzstd1 (!= 1.3.8+dfsg-3+deb10u2) but 1.4.8+dfsg-2.1 is to be installed
 zlib1g : Breaks: zlib1g:i386 (!= 1:1.2.11.dfsg-2) but 1:1.2.11.dfsg-1 is to be installed
 zlib1g:i386 : Breaks: zlib1g (!= 1:1.2.11.dfsg-1) but 1:1.2.11.dfsg-2 is to be installed
 zlib1g-dev : Depends: zlib1g (= 1:1.2.11.dfsg-1) but 1:1.2.11.dfsg-2 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

apt -f 安装输出:

root@CBTS-WBPC5:/home/cbts/Downloads# apt -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  dkms libasound2-dev libblkid-dev libcaca-dev libelf1:i386 libgles1 libglib2.0-dev libglib2.0-dev-bin libglvnd-dev libglvnd0:i386
  libmount-dev libomxil-bellagio-bin libomxil-bellagio0 libpcre16-3 libpcre3-dev libpcre32-3 libpcrecpp0v5 libpng-dev libpng-tools
  libpulse-dev libselinux1-dev libsensors5:i386 libsepol1-dev libsfml-audio2.5 libsfml-graphics2.5 libsfml-network2.5
  libsfml-system2.5 libsfml-window2.5 libslang2-dev libtinfo5:i386 libwayland-server0:i386 libxcb-dri2-0:i386 libxcb-dri3-0:i386
  libxcb-glx0:i386 libxcb-present0:i386 libxcb-sync1:i386 libxcb-xfixes0:i386 libxdamage1:i386 libxshmfence1:i386 mono-llvm-tools
  qt5-qmake qt5-qmake-bin qtbase5-dev-tools uuid-dev
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  libbsd0 libdrm2:i386 libedit2 libelf1 libexpat1 libncurses6 libstdc++6 libtinfo6 libvulkan1 libwayland-client0 libx11-6
  libx11-xcb1 libxau6 libxcb-dri3-0 libxcb-present0 libxcb-randr0 libxcb-sync1 libzstd1 zlib1g
The following NEW packages will be installed:
  libdrm2:i386
The following packages will be DOWNGRADED:
  libbsd0 libedit2 libelf1 libexpat1 libncurses6 libstdc++6 libtinfo6 libvulkan1 libwayland-client0 libx11-6 libx11-xcb1 libxau6
  libxcb-dri3-0 libxcb-present0 libxcb-randr0 libxcb-sync1 libzstd1 zlib1g
0 upgraded, 1 newly installed, 18 downgraded, 0 to remove and 3 not upgraded.
42 not fully installed or removed.
Need to get 0 B/3,156 kB of archives.
After this operation, 480 kB disk space will be freed.
Do you want to continue? [Y/n] y
dpkg: warning: downgrading libstdc++6:amd64 from 10.2.1-6 to 8.3.0-6
(Reading database ... 313759 files and directories currently installed.)
Preparing to unpack .../libstdc++6_8.3.0-6_amd64.deb ...
Unpacking libstdc++6:amd64 (8.3.0-6) over (10.2.1-6) ...
dpkg: error processing archive /var/cache/apt/archives/libstdc++6_8.3.0-6_amd64.deb (--unpack):
 trying to overwrite shared '/usr/share/doc/libstdc++6', which is different from other instances of package libstdc++6:amd64
Errors were encountered while processing:
 /var/cache/apt/archives/libstdc++6_8.3.0-6_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我尝试过的:

  • apt -f 安装
  • 删除了 Sid 存储库和 apt 更新

uname -a:Linux CBTS-WBPC5 4.19.0-16-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 GNU/Linux

答案1

正如您发现的那样,跨主要版本边界进行升级(旧稳定到/从稳定到/从不稳定等)是一个真是个坏主意。 Debian 有一个 Backports 版本树,它可以从较新版本向后移植更新的软件包不是破坏您当前的安装 - 如果没有向后移植,那是因为它(尚未)尚未被证明可以在不破坏您的情况下工作。

[通读下面的整个描述。明白它。如果您遇到无法连接到互联网并查看网络的情况,请将其打印出来以供日后参考。 ETC。]

你有很多工作要解决你的问题,如果它可以修复的话。您必须删除所有不适合您安装的版本的存储库。我个人使用 Buster,并且会不是使用稳定版,即使它们是现在一样的东西。这是因为最终,Sid 将成为新的 Stable,而 Buster 将成为 OldStable,当您更新时,您现在遇到的同样的混乱也会随之而来。 (就我个人而言,我认为整个旧的稳定/稳定/不稳定的事情过去和现在仍然是 Debian 考虑和实施最糟糕的事情之一!)

执行以下命令或多或少地重置您的 apt 缓存和数据库(sudo如果您在以 root 身份登录时不执行命令,则在命令前加上前缀):

apt-get autoremove
apt-get clean
apt-get autoclean
apt-get update
apt-get check

[旁注:当此过程正在进行时,请执行不是执行任何其他更新或任何其他apt-get update命令。]

然后,您必须找到升级到 Sid 软件包级别的每个软件包(或者没有合适的 Buster 版本可用)。您可以使用Debian 的软件包搜索功能帮助缩小哪个版本适用于哪个版本。暂时避免使用 --force 选项!

一旦获得了需要降级的软件包列表,请尝试将它们一一降级。有些会在这一点上失败,因此请跳过它们,但将它们保留在列表中 - 并删除成功的那些。一旦您浏览完该列表,请再浏览一遍。重复这样做一段时间。这最终会将列表缩减为一些最有问题的软件包。在某些情况下,Sid 中可能存在某个包,但 Buster 中根本不存在——只需删除(清除)这些包即可。

一旦你浏览完这个列表(可能几十次),你可能仍然有一些包根本不会降级,因为它们的依赖项不会或不能降级。这些是您可能必须使用 --force 选项降级的。 Prefer--强制降级它们的依赖关系第一的,因为一旦降级,依赖于它们的软件包可能会决定它最终可以自行降级。

您将必须重复执行此过程数十次。除非绝对必要,否则尽量避免重新启动或重新启动服务或应用程序。 (您不想降级最终会阻止您启动的东西,直到它的所有依赖项都同样降级,这样它才能工作!)

最终,您会将它们全部降级,或者顽固的软件包数量会减少。此时,您将必须手动检查它们以找出需要哪些 sep 才能降级它们。您必须检查它们的依赖关系等,并可能删除一些根本不应该存在于 Buster 中的软件包(它们仅特定于 Sid)。

如果一切顺利,您希望将所有内容降级回 Buster 内有效的状态。一旦达到这一点,您就可以安全地执行apt-get update并将任何 Buster 软件包升级到最新的可用版本(仍然确保您不会更新任何应该属于 Sid 但不属于 Buster 的软件包!)

如果一切顺利的话,你应该完成了。

如果在某个时候,您遇到无法修复的问题,您可能需要手动删除 apt 的软件包缓存、软件包列表等,以将其重置为原始状态。这种复杂性是另一个需要在此处发布的大量说明的问题。网络上有几个 Debian 特定页面详细介绍了这一切,因此请查找它们。 (并打印它们!您希望在降级过程中以硬拷贝方式访问您可能需要的任何内容,这可能会同时中断您的互联网访问 - 因此您需要纸质副本来阅读和参考。或者如果打印太多,有第二台可以工作的计算机,可以用来访问互联网和网络。)

祝你好运。

相关内容