我试图以一种“不”的方式升级我的libc6版本。这一切都始于我试图将我的MariaDB从10.1更新到10.2。然后,我不知怎么发现,已经安装的libc6=1.24不够好,它需要libc6=1.27。当我在下载的包上使用dpkg -i
时,我设法中断了安装:http://archive.ubuntu.com/ubuntu/pool/main/g/glibc/ (特别是libc6 6_2.27-3 ubuntu1_amd64.deb)。我允许它自动解构我的其他软件包,这就是我知道我毁了它的时候。
我的系统在运行
root@redfox:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 9.13 (stretch)
Release: 9.13
Codename: stretch
现在,每当我尝试使用dpkg,或者尝试运行apt-get upgrade
时,我都会运行缺少的程序,并且有丢失/中断的依赖项。这是输出:
root@redfox:~# sudo apt-get 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:
cups-core-drivers hplip-data libart-2.0-2 libcupscgi1 libgutenprint2 libsane-hpaio python3-pexpect python3-pil python3-ptyprocess
python3-renderpm python3-reportlab python3-reportlab-accel
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
hplip libgcc1:i386 printer-driver-gutenprint printer-driver-hpcups printer-driver-postscript-hp
0 upgraded, 0 newly installed, 5 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 4370 kB disk space will be freed.
Do you want to continue? [Y/n] n
Abort.
root@redfox:~# dpkg --configure -a
dpkg: warning: 'ldconfig' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
我曾试图再次降级为libc6版本1.24,但我不确定这是否效果太好。我也尝试过清除包缓存,自动清理等,但不幸的是,我很难确定下一步该去哪里。我试图研究我能做什么,但很难理解,因为我觉得这对我的状态来说是一个非常具体的问题,不幸的是。
我尝试过cp /bin/true /sbin/ldconfig
,因为我发现/sbin/ldconfig
失踪了。然而,该系统的破坏似乎比最初设想的还要严重。下面是我试图安装Stephen的答案中建议的软件包时的输出:
sudo dpkg -i libc-bin_2.24-11+deb9u4_amd64.deb locales_2.24-11+deb9u4_all.deb
Selecting previously unselected package libc-bin.
(Reading database ... 202484 files and directories currently installed.)
Preparing to unpack libc-bin_2.24-11+deb9u4_amd64.deb ...
Unpacking libc-bin (2.24-11+deb9u4) ...
Selecting previously unselected package locales.
Preparing to unpack locales_2.24-11+deb9u4_all.deb ...
Unpacking locales (2.24-11+deb9u4) ...
dpkg: dependency problems prevent configuration of libc-bin:
libc-bin depends on libc6 (>> 2.24); however:
Package libc6:amd64 is not configured yet.
libc-bin depends on libc6 (<< 2.25); however:
Version of libc6:amd64 on system is 2.27-3ubuntu1.
dpkg: error processing package libc-bin (--install):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of locales:
locales depends on libc-bin (>> 2.24); however:
Package libc-bin is not configured yet.
libc6:amd64 (2.27-3ubuntu1) breaks locales (<< 2.27) and is unpacked but not configured.
Version of locales to be configured is 2.24-11+deb9u4.
dpkg: error processing package locales (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
libc-bin
locales
发布于 2020-11-02 08:00:47
您可能需要重新安装所有与libc相关的包,特别是libc6
本身、libc-bin
、locales
和libc-l10n
:
wget http://deb.debian.org/debian/pool/main/g/glibc/libc6_2.24-11+deb9u4_amd64.deb http://deb.debian.org/debian/pool/main/g/glibc/libc-bin_2.24-11+deb9u4_amd64.deb http://deb.debian.org/debian/pool/main/g/glibc/locales_2.24-11+deb9u4_all.deb http://deb.debian.org/debian/pool/main/g/glibc/libc-l10n_2.24-11+deb9u4_all.deb
dpkg -i libc6_2.24-11+deb9u4_amd64.deb libc-bin_2.24-11+deb9u4_amd64.deb locales_2.24-11+deb9u4_all.deb libc-l10n_2.24-11+deb9u4_all.deb
也请检查您的PATH
(请参阅问题中显示的最后一条错误消息)。
由于您的/sbin/ldconfig
已经没有了,您需要稍微修改一下东西,以便让dpkg
安装这些包:
cp /bin/true /sbin/ldconfig
这将使dpkg
能够进行足够的操作来安装真正的ldconfig
。
发布于 2020-11-02 06:47:25
尝试运行apt-get upgrade -f
-f,尝试修复丢失或损坏的包。如果这没有成功,请张贴全部输出。
当自动修复失败时,进一步的选项:
echo $PATH
以确保它包含正确的位置。提示:如果您需要debian的新包,请不要使用ubuntu包。这些措施可能会奏效,但很有可能破坏这一体系。debian系统的一个更好的来源是来自debian的不稳定/测试分支的包。另一种选择是使用“backport”。对于目标软件的更新版本,这些包需要尽可能少的新库。
https://unix.stackexchange.com/questions/617549
复制相似问题