使用 dpkg 卸载 libc6 包

使用 dpkg 卸载 libc6 包

我已经在我的 ubuntu 服务器 12.04 上安装了“libc6_2.17-0ubuntu5.1_amd64.deb”。系统上的原始 libc6 是 2.15。安装软件包后,我通过以下方式检查它:

ldd --version

表明:

ldd (Ubuntu EGLIBC 2.15-0ubuntu10.5) 2.15

没有变化。然后我发现我无法通过 apt-get 安装任何依赖于 libc6 的东西,它会报告:

The following packages have unmet dependencies:
 libc-dev-bin : Depends: libc6 (< 2.16) but 2.17-0ubuntu5.1 is to be installed
 libc6-dev : Depends: libc6 (= 2.15-0ubuntu10.5) but 2.17-0ubuntu5.1 is to be installed
 libnih1 : PreDepends: libc6 (< 2.16) but 2.17-0ubuntu5.1 is to be installed

因此我尝试卸载 debian 包,首先我检查:

dpkg -l | grep libc6
ii  libc6            2.17-0ubuntu5.1       Embedded GNU C Library: Shared libraries
ii  libc6-dev        2.15-0ubuntu10.5      Embedded GNU C Library: Development Libraries and Header Files

然后

dpkg -r libc6

它打印出许多依赖于 libc6 的软件包并告诉我:

dpkg: error processing libc6 (--remove):
 dependency problems - not removing
Errors were encountered while processing:
 libc6

似乎它不知道系统上有 2 个版本的 libc6。

使用

dpkg --get-selections

得到:

libc6                                           deinstall
libc6-dev                                       install

我应该怎么做?

答案1

我已经用 aptitude 重新安装了。它比 apt-get 和 dpkg 强大得多,它们都无法重新安装。

sudo aptitude reinstall libc6

The following packages will be REINSTALLED:
  libc6 
0 packages upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
The following packages have unmet dependencies:
 libc6-dev : Depends: libc6 (= 2.15-0ubuntu10.5) but 2.17-0ubuntu5.1 is installed.
 libc-dev-bin : Depends: libc6 (< 2.16) but 2.17-0ubuntu5.1 is installed.
 libnih1 : PreDepends: libc6 (< 2.16) but 2.17-0ubuntu5.1 is installed.
E: I wasn't able to locate a file for the libc6 package. This might mean you need to manually fix this package.
The following actions will resolve these dependencies:

     Downgrade the following packages:                                                                     
1)     libc-bin [2.15-0ubuntu10.5 (now, precise-security, precise-updates) -> 2.15-0ubuntu10 (precise)]    
2)     libc-dev-bin [2.15-0ubuntu10.5 (now, precise-security, precise-updates) -> 2.15-0ubuntu10 (precise)]
3)     libc6 [2.17-0ubuntu5.1 (now) -> 2.15-0ubuntu10 (precise)]                                           
4)     libc6-dev [2.15-0ubuntu10.5 (now, precise-security, precise-updates) -> 2.15-0ubuntu10 (precise)]

Accept this solution? [Y/n/q/?] y
The following packages will be DOWNGRADED:
  libc-bin libc-dev-bin libc6 libc6-dev 
0 packages upgraded, 0 newly installed, 4 downgraded, 0 to remove and 0 not upgraded.
Need to get 8,852 kB of archives. After unpacking 88.1 kB will be freed.
Do you want to continue? [Y/n/?] y

aptitude 提示有 4 个软件包属于 libc6,但我只通过 deb 文件安装了其中一个。也许这就是系统崩溃的原因

答案2

正如 @jean 提到的,您需要将软件包降级以满足系统需求:

  1. 检查你正在使用的 Ubuntu 版本
  2. 从此处下载 libc6 或相关的 deb 包关联
  3. 你将使用以下命令通过终端安装下载的 .deb 文件:例如
sudo dpkg -i --auto-deconfigure '/home/your-system-name/Downloads/libc6_2.30-0ubuntu2_amd64.deb

类似地,您可以输入sudo dpkg -i --auto-deconfigure并拖放 .deb 文件,然后您将获得与上面类似的结果。**

  1. 安装完成后,运行
sudo apt-get update && sudo apt-get upgrade && sudo apt-get install
  1. 您还可以使用Synaptic 软件包管理器重新安装任何缺失的软件包。

你会没事的。今天我不得不在 Zorin OS 15.2 上将 libc6-2.30 降级到 libc6-2.28-10,这样就成功了。

相关内容