我使用的是 Ubuntu 18.04,我尝试将 libc6 从版本 2.27 升级到 2.29,但我最终破坏了包系统。我无法修复,因为当我尝试使用修复命令时,它总是显示系统中的大量软件包将被删除。
Synaptic 显示这些软件包已损坏:
- glibc 文档 2.27-3
- libc-dev-bin 2.27-3
- libc6 2.29-0
- libc6-dbg 2.27-3
- libc6-dev 2.27-3
- libc6:i386 2.27-3
我怎么破的?我从https://packages.ubuntu.com/下载了以下软件包
- glibc-doc_2.29-0ubuntu2_all.deb
- glibc-source_2.29-0ubuntu2_all.deb
- libc6_2.29-0ubuntu2_amd64.deb
- libc6-amd64_2.29-0ubuntu2_i386.deb
- libc-bin_2.29-0ubuntu2_amd64.deb
- locales_2.29-0ubuntu2_all.deb
我试图通过 dpkg 一个一个地安装它们,但由于依赖错误而没有工作,最后我使用了这个命令:
sudo dpkg -i libc-bin_2.29-0ubuntu2_amd64.deb libc6_2.29-0ubuntu2_amd64.deb libc6-amd64_2.29-0ubuntu2_i386.deb
之后,我在提示中说“是”,提示需要重新启动一些程序,如 postgres。
然后我看到了损坏的包错误。
sudo apt update
没有错误。当我尝试修复时,它显示几乎所有需要删除的东西:
sudo apt install -f
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:
alex freeglut3 freeglut3-dev happy hscolour libbsd-dev libdrm-dev libffi-dev
libgl1-mesa-dev libgles1 libglu1-mesa-dev libglvnd-core-dev libglvnd-dev
libgmp-dev libgmpxx4ldbl libopengl0 libtinfo-dev libx11-xcb-dev
libx11-xcb1:i386 libxcb-dri2-0-dev libxcb-dri3-dev libxcb-glx0-dev
libxcb-present-dev libxcb-randr0-dev libxcb-render0-dev libxcb-shape0-dev
libxcb-sync-dev libxcb-xfixes0-dev libxdamage-dev libxext-dev libxfixes-dev
libxi-dev libxmu-dev libxmu-headers libxshmfence-dev libxxf86vm-dev
linux-headers-4.18.0-17 linux-headers-4.18.0-17-generic
linux-image-4.18.0-17-generic linux-libc-dev linux-modules-4.18.0-17-generic
linux-modules-extra-4.18.0-17-generic mesa-common-dev x11proto-damage-dev
x11proto-fixes-dev x11proto-xext-dev x11proto-xf86vidmode-dev
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
glibc-doc-reference
The following packages will be REMOVED:
build-essential cabal-install g++ g++-7 ghc haskell-platform libbsd0:i386
libc-dev-bin libc6:i386 libc6-amd64:i386 libc6-dbg libc6-dev
libdrm-amdgpu1:i386 libdrm-intel1:i386 libdrm-nouveau2:i386
libdrm-radeon1:i386 libdrm2:i386 libedit2:i386 libelf1:i386 libexpat1:i386
libffi6:i386 libgcc1:i386 libghc-async-dev libghc-attoparsec-dev
libghc-call-stack-dev libghc-case-insensitive-dev libghc-fgl-dev
libghc-fixed-dev libghc-gluraw-dev libghc-glut-dev libghc-half-dev
libghc-hashable-dev libghc-haskell-src-dev libghc-html-dev libghc-http-dev
libghc-hunit-dev libghc-integer-logarithms-dev libghc-mtl-dev
libghc-network-dev libghc-network-uri-dev libghc-objectname-dev
libghc-opengl-dev libghc-openglraw-dev libghc-parallel-dev
libghc-parsec3-dev libghc-primitive-dev libghc-quickcheck2-dev
libghc-random-dev libghc-regex-base-dev libghc-regex-compat-dev
libghc-regex-posix-dev libghc-scientific-dev libghc-split-dev
libghc-statevar-dev libghc-stm-dev libghc-syb-dev libghc-text-dev
libghc-tf-random-dev libghc-unordered-containers-dev libghc-vector-dev
libghc-zlib-dev libgl1:i386 libgl1-mesa-dri:i386 libgl1-mesa-glx:i386
libglapi-mesa:i386 libglvnd0:i386 libglx-mesa0:i386 libglx0:i386
libllvm7:i386 libncurses5-dev libnvidia-compute-418:i386
libnvidia-decode-418:i386 libnvidia-encode-418:i386 libnvidia-fbc1-418:i386
libnvidia-gl-418:i386 libnvidia-ifr1-418:i386 libpciaccess0:i386
libsensors4:i386 libstdc++-7-dev libstdc++6:i386 libtinfo5:i386
libx11-6:i386 libxau6:i386 libxcb-dri2-0:i386 libxcb-dri3-0:i386
libxcb-glx0:i386 libxcb-present0:i386 libxcb-sync1:i386 libxcb1:i386
libxdamage1:i386 libxdmcp6:i386 libxext6:i386 libxfixes3:i386
libxshmfence1:i386 libxxf86vm1:i386 zlib1g:i386 zlib1g-dev
The following NEW packages will be installed:
glibc-doc-reference
0 upgraded, 1 newly installed, 97 to remove and 0 not upgraded.
6 not fully installed or removed.
Need to get 5.483 kB of archives.
After this operation, 1.303 MB disk space will be freed.
Do you want to continue? [Y/n]
Apt 没有损坏 - 它仍然可以正常工作。但是您不明智地告诉 apt 制作一个Frankensystem,混合来自不同版本的 Ubuntu 的软件包。
Apt 将无法解决现在不合逻辑的依赖关系……永远。(你也不会)。由于 apt 无法运行,因此在您删除错误版本的软件包之前,您将永远不会获得任何升级或安全补丁。
我们不为 Frankensystems 提供支持。根据定义,它们不稳定,容易出现异常且难以诊断的问题。基于 Deb 的系统被设计为具有特定版本的包的功能。错误版本的软件包会导致问题。
删除错误版本的软件包。如果要运行 19.04 软件包,请考虑安装 Ubuntu 19.04。如果您希望保留当前的 18.04 系统,可能在虚拟机或备用分区中。
我通过下载所有这些软件包的 2.27 版本并在它们上运行 dpkg 来修复。
在我崩溃之前,我尝试以相同的顺序安装它们。我在多个 deb 文件上使用 dpkg 来防止循环依赖或类似的东西。不确定它是否会改变任何东西。
因此,真正的解决方案是升级发行版,如果您需要一个库,该库仅随新发行版提供并且一些游戏需要...
如果您打算在 Ubuntu 系统上玩游戏,那么到 2023 年 18.04 的支持就这么多……例如,我从 2020 年开始有三款 Linux 游戏,一旦更新,需要 glibc6-2.29 或更高版本!除了对我来说,这意味着下载新的发行版 ISO 并进行完整安装!由于 disptr-upgrade 失败...