首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法安装libc6 6-dev。

无法安装libc6 6-dev。
EN

Ask Ubuntu用户
提问于 2018-07-16 19:52:25
回答 3查看 16.4K关注 0票数 7

gcc的编译器出了问题,在修复过程中,libc6包的一部分被卸载了。现在,我试图使用apt在Ubuntu14.04(3.13.0-24-泛型)重新安装它。然而,sudo apt install libc6-dev提供了以下错误消息:

代码语言:javascript
运行
复制
The following packages have unmet dependencies:
 libc6-dev : Depends: libc6 (= 2.19-10ubuntu2) but 2.19-10ubuntu2.1 is to be installed
E: Unable to correct problems, you have held broken packages.

我尝试过使用智能安装,卸载各种包,基本上是我能想到的命令的每一个变体。但是,它们都给出了该错误的一个变体。我怎样才能解决这个问题,或者至少解决这个问题来安装gcc和gfortran?

编辑:

下面是apt-cache policy libc6 libc6-dev的输出:

代码语言:javascript
运行
复制
libc6:
  Installed: 2.19-10ubuntu2.1
  Candidate: 2.19-10ubuntu2.1
  Version table:
 *** 2.19-10ubuntu2.1 0
        100 /var/lib/dpkg/status
     2.19-10ubuntu2 0
        500 http://old-releases.ubuntu.com/ubuntu/ utopic/main amd64 Packages

libc6-dev:
  Installed: (none)
  Candidate: 2.19-10ubuntu2
  Version table:
     2.19-10ubuntu2 0
        500 http://old-releases.ubuntu.com/ubuntu/ utopic/main amd64 Packages

cat /etc/os-release的输出是:

代码语言:javascript
运行
复制
NAME="Ubuntu" VERSION="14.10 (Utopic Unicorn)" ID=ubuntu
ID_LIKE=debian PRETTY_NAME="Ubuntu 14.10" VERSION_ID="14.10"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"

grep utopic -ir /etc/apt/sources.list /etc/apt/sources.list.d/*.list给出了:

代码语言:javascript
运行
复制
/etc/apt/sources.list:deb http://old-releases.ubuntu.com/ubuntu utopic
main universe restricted multiverse /etc/apt/sources.list:deb-src
http://old-releases.ubuntu.com/ubuntu utopic main universe restricted
multiverse #Added by software-properties /etc/apt/sources.list:# deb
http://old-releases.ubuntu.com/ubuntu/ utopic-security main universe
restricted multiverse /etc/apt/sources.list:deb-src
http://old-releases.ubuntu.com/ubuntu/ utopic-security main universe
restricted multiverse #Added by software-properties
/etc/apt/sources.list:# deb http://old-releases.ubuntu.com/ubuntu
utopic-updates main universe restricted multiverse
/etc/apt/sources.list:deb-src http://old-releases.ubuntu.com/ubuntu
utopic-updates main universe restricted multiverse #Added by
software-properties
/etc/apt/sources.list.d/george-edison55-ubuntu-cmake-3_x-utopic.list:deb
http://ppa.launchpad.net/george-edison55/cmake-3.x/ubuntu utopic main
/etc/apt/sources.list.d/george-edison55-ubuntu-cmake-3_x-utopic.list:#
deb-src http://ppa.launchpad.net/george-edison55/cmake-3.x/ubuntu
utopic main
/etc/apt/sources.list.d/graphics-drivers-ubuntu-ppa-utopic.list:deb
http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu utopic main
/etc/apt/sources.list.d/graphics-drivers-ubuntu-ppa-utopic.list:#
deb-src http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu utopic
main
/etc/apt/sources.list.d/gwendal-lebihan-dev-cinnamon-nightly-utopic.list:deb
http://ppa.launchpad.net/gwendal-lebihan-dev/cinnamon-nightly/ubuntu
utopic main
/etc/apt/sources.list.d/gwendal-lebihan-dev-cinnamon-nightly-utopic.list:#
deb-src
http://ppa.launchpad.net/gwendal-lebihan-dev/cinnamon-nightly/ubuntu
utopic main
/etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-utopic.list:deb
http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu utopic main
/etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-utopic.list:#
deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu utopic
main
/etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-utopic.list:#
deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu utopic
main

当我尝试sudo apt-get install --reinstall libc6时,我得到以下消息:

代码语言:javascript
运行
复制
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reinstallation of libc6 is not possible, it cannot be downloaded.
The following packages will be REMOVED:
  nvidia-331-updates
0 upgraded, 0 newly installed, 1 to remove and 2 not upgraded.
1 not fully installed or removed.
After this operation, 184 MB disk space will be freed.
Do you want to continue? [Y/n]

这是sudo apt-get install libc6=2.19-10ubuntu2的输出

代码语言:javascript
运行
复制
The following packages will be REMOVED:
  lib32gcc1 lib32z1 libc6:i386 libc6-i386 libgcc1:i386 nvidia-331-updates
  retty:i386
The following packages will be DOWNGRADED:
  libc6
0 upgraded, 0 newly installed, 1 downgraded, 7 to remove and 2 not upgraded.
1 not fully installed or removed.
Need to get 4,765 kB of archives.
After this operation, 204 MB disk space will be freed.
Do you want to continue? [Y/n] Y
Get:1 http://old-releases.ubuntu.com/ubuntu/ utopic/main libc6 amd64 2.19-10ubuntu2 [4,765 kB]
Fetched 4,765 kB in 0s (5,794 kB/s)
Can't exec "locale": No such file or directory at /usr/share/perl5/Debconf/Encoding.pm line 16.
Use of uninitialized value $Debconf::Encoding::charmap in scalar chomp at /usr/share/perl5/Debconf/Encoding.pm line 17.
Preconfiguring packages ...
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
E: Sub-process /usr/bin/dpkg returned an error code (2)

下面是出现在sudo apt-get update之后的错误消息:

代码语言:javascript
运行
复制
W: Failed to fetch http://ppa.launchpad.net/gwendal-lebihan-dev/cinnamon-nightly/ubuntu/dists/utopic/InRelease  Unable to find expected entry 'main/binary-foreign-architecture/Packages' in Release file (Wrong sources.list entry or malformed file)

W: Failed to fetch http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu/dists/utopic/InRelease  Unable to find expected entry 'main/binary-foreign-architecture/Packages' in Release file (Wrong sources.list entry or malformed file)

W: Failed to fetch http://ppa.launchpad.net/george-edison55/cmake-3.x/ubuntu/dists/utopic/Release  Unable to find expected entry 'main/binary-foreign-architecture/Packages' in Release file (Wrong sources.list entry or malformed file)

W: Failed to fetch http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu/dists/utopic/main/binary-amd64/Packages  404  Not Found

W: Failed to fetch http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu/dists/utopic/main/binary-foreign-architecture/Packages  404  Not Found

W: Failed to fetch http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu/dists/utopic/main/binary-i386/Packages  404  Not Found

W: Failed to fetch http://old-releases.ubuntu.com/ubuntu/dists/utopic/Release  Unable to find expected entry 'main/binary-foreign-architecture/Packages' in Release file (Wrong sources.list entry or malformed file)

下面是ls -la /lib/x86_64-linux-gnu/libc*的输出:

代码语言:javascript
运行
复制
-rwxr-xr-x 1 root root 1844160 Dec  1  2014 /lib/x86_64-linux-gnu/libc-2.19.so
lrwxrwxrwx 1 root root      14 Feb 21  2014 /lib/x86_64-linux-gnu/libcap.so.2 -> libcap.so.2.24
-rw-r--r-- 1 root root   18952 Feb 21  2014 /lib/x86_64-linux-gnu/libcap.so.2.24
lrwxrwxrwx 1 root root      21 Dec 15  2014 /lib/x86_64-linux-gnu/libcgmanager.so.0 -> libcgmanager.so.0.0.0
-rw-r--r-- 1 root root  133056 Dec 15  2014 /lib/x86_64-linux-gnu/libcgmanager.so.0.0.0
-rw-r--r-- 1 root root  194968 Dec  1  2014 /lib/x86_64-linux-gnu/libcidn-2.19.so
lrwxrwxrwx 1 root root      15 Dec  1  2014 /lib/x86_64-linux-gnu/libcidn.so.1 -> libcidn-2.19.so
lrwxrwxrwx 1 root root      17 Jul  7  2014 /lib/x86_64-linux-gnu/libcom_err.so.2 -> libcom_err.so.2.1
-rw-r--r-- 1 root root   14592 Jul  7  2014 /lib/x86_64-linux-gnu/libcom_err.so.2.1
-rw-r--r-- 1 root root   43368 Dec  1  2014 /lib/x86_64-linux-gnu/libcrypt-2.19.so
-rw-r--r-- 1 root root 1961344 Jan  9  2015 /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
lrwxrwxrwx 1 root root      16 Dec  1  2014 /lib/x86_64-linux-gnu/libcrypt.so.1 -> libcrypt-2.19.so
lrwxrwxrwx 1 root root      12 Dec  1  2014 /lib/x86_64-linux-gnu/libc.so.6 -> libc-2.19.so
EN

回答 3

Ask Ubuntu用户

回答已采纳

发布于 2018-07-24 07:01:51

好吧,让我们从头开始:

您可以按照用户@doug的建议来解决您的问题:

代码语言:javascript
运行
复制
wget https://launchpad.net/~ubuntu-security/+archive/ubuntu/ppa/+build/6608877/+files/libc6-dev_2.19-10ubuntu2.1_amd64.deb
sudo dpkg -i libc6-dev_2.19-10ubuntu2.1_amd64.deb

如果这是可行的,你可以投票这个答案,但是,不要接受这一点。等到最初的作者发布答案,然后接受它。

但是,请记住,使用这种方法只会绕过真正的问题。您不能更新您的存储库,添加PPA,或者在最坏的情况下,如果您的包缓存发生了什么事情,请安装其他程序。因此,如果没有其他帮助,我建议您使用此方法。

如果您真的想彻底解决问题,那么:

第1步:开始使用sources.list清理混乱:

运行以下命令以删除正式Ubuntu存储库以外的PPA,因为它们已经过时:

代码语言:javascript
运行
复制
sudo rm /etc/apt/sources.list.d/*.list

然后备份,打开并编辑sources.list

代码语言:javascript
运行
复制
sudo cp /etc/apt/sources.list /etc/apt/sources.list.old
sudo gedit /etc/apt/sources.list

从那里删除所有内容并添加以下行:

代码语言:javascript
运行
复制
deb http://old-releases.ubuntu.com/ubuntu utopic main universe restricted multiverse
deb http://old-releases.ubuntu.com/ubuntu/ utopic-security main universe restricted multiverse
deb http://old-releases.ubuntu.com/ubuntu utopic-updates main universe restricted multiverse

保存并退出。

步骤2:更新存储库:

运行以下命令:

代码语言:javascript
运行
复制
sudo apt-get update

确保此命令完美无缺。如果发生GPG错误,请添加密钥并再次更新存储库:

代码语言:javascript
运行
复制
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 16126D3A3E5C1192

步骤3:修复ldconfig

运行以下命令:

代码语言:javascript
运行
复制
wget http://launchpadlibrarian.net/172657659/libc-bin_2.19-0ubuntu6_amd64.deb
dpkg -x libc-bin*.deb libdir/
sudo cp libdir/sbin/ldconfig /sbin/
sudo dpkg -i libc-bin*.deb
sudo apt-get install -f

部分取自这里

步骤4:安装:

运行以下命令:

代码语言:javascript
运行
复制
sudo apt-get install libc6=2.19-10ubuntu2
sudo apt-get install libc6-dev

希望这能帮上忙。

票数 3
EN

Ask Ubuntu用户

发布于 2023-02-02 06:55:14

当我试图在干净的Ubuntu22.04.1LTS上运行mozilla的深度语音示例芬伯_瓦德_流式传输时,我遇到了一个类似于问题的错误。

首先,在安装节点包时出错:

代码语言:javascript
运行
复制
npm ERR! /usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h:9:16: fatal error: stdint.h: No such file or directory
npm ERR!     9 | # include_next <stdint.h>

解决方案将安装libc6-dev

代码语言:javascript
运行
复制
$ sudo apt install libc6-dev
The following packages have unmet dependencies:
 libc6-dev : Depends: libc6 (= 2.35-0ubuntu3) but 2.35-0ubuntu3.1 is to be installed
E: Unable to correct problems, you have held broken packages.

所以我想详述一下Olimjon的回答,这给了我一个解决问题的方法。

我能够通过查找来自干扰更新的libc-dev-binlibc6-dev包来修复它。下载了它们,然后:

代码语言:javascript
运行
复制
sudo dpkg -i libc-dev-bin_2.35-0ubuntu3.1_amd64.deb
sudo apt install linux-libc-dev libcrypt-dev rpcsvc-proto libtirpc-dev libnsl-dev
sudo dpkg -i libc6-dev_2.35-0ubuntu3.1_amd64.deb
票数 0
EN

Ask Ubuntu用户

发布于 2018-07-16 20:00:33

你试过只安装libc3 3-dev吗?

此外,您还可以键入sudo apt搜索libc3,这给我显示了两个包。

代码语言:javascript
运行
复制
Sorting... Done
Full Text Search... Done
libc3p0-java/bionic,bionic 0.9.1.2-9 all
library for JDBC connection pooling

libc3p0-java-doc/bionic,bionic 0.9.1.2-9 all
library for JDBC connection pooling (documentation)
票数 -4
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1056678

复制
相关文章

相似问题

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