首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >安装错误的libc6软件包和坏系统

安装错误的libc6软件包和坏系统
EN

Unix & Linux用户
提问于 2020-11-02 04:36:51
回答 2查看 6.2K关注 0票数 1

背景

我试图以一种“不”的方式升级我的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)。我允许它自动解构我的其他软件包,这就是我知道我毁了它的时候。

我的系统在运行

代码语言:javascript
运行
复制
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时,我都会运行缺少的程序,并且有丢失/中断的依赖项。这是输出:

代码语言:javascript
运行
复制
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,但我不确定这是否效果太好。我也尝试过清除包缓存,自动清理等,但不幸的是,我很难确定下一步该去哪里。我试图研究我能做什么,但很难理解,因为我觉得这对我的状态来说是一个非常具体的问题,不幸的是。

编辑#1

我尝试过cp /bin/true /sbin/ldconfig,因为我发现/sbin/ldconfig失踪了。然而,该系统的破坏似乎比最初设想的还要严重。下面是我试图安装Stephen的答案中建议的软件包时的输出:

代码语言:javascript
运行
复制
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
EN

回答 2

Unix & Linux用户

回答已采纳

发布于 2020-11-02 08:00:47

您可能需要重新安装所有与libc相关的包,特别是libc6本身、libc-binlocaleslibc-l10n

代码语言:javascript
运行
复制
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安装这些包:

代码语言:javascript
运行
复制
cp /bin/true /sbin/ldconfig

这将使dpkg能够进行足够的操作来安装真正的ldconfig

票数 4
EN

Unix & Linux用户

发布于 2020-11-02 06:47:25

尝试运行apt-get upgrade -f -f,尝试修复丢失或损坏的包。如果这没有成功,请张贴全部输出。

当自动修复失败时,进一步的选项:

  • 找到破损的包装,并尝试删除它,然后重新安装它的来源。
  • 检查echo $PATH以确保它包含正确的位置。

提示:如果您需要debian的新包,请不要使用ubuntu包。这些措施可能会奏效,但很有可能破坏这一体系。debian系统的一个更好的来源是来自debian的不稳定/测试分支的包。另一种选择是使用“backport”。对于目标软件的更新版本,这些包需要尽可能少的新库。

票数 0
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/617549

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档