安装build-essential失败,如何解决?

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
狗尾草
帖子: 18
注册时间: 2007-10-03 8:40

安装build-essential失败,如何解决?

#1

帖子 狗尾草 » 2016-05-29 22:42

sudo apt-get install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
build-essential : Depends: libc6-dev but it is not going to be installed or
libc-dev
Depends: gcc (>= 4:4.4.3) but it is not going to be installed
Depends: g++ (>= 4:4.4.3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.





一步步尝试安装依赖,在安装libc-dev时提示如下
sudo apt-get install libc-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libc6-dev' instead of 'libc-dev'
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
libc6-dev : Depends: libc6 (= 2.19-0ubuntu6.6) but 2.19-0ubuntu6.7 is to be installed
Recommends: gcc but it is not going to be installed or
c-compiler
E: Unable to correct problems, you have held broken packages.


/etc/apt/sources.list 如下:
deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse


版本是:
Distributor ID: Ubuntu
Description: Ubuntu 14.04.4 LTS
Release: 14.04
Codename: trusty
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: 安装build-essential失败,如何解决?

#2

帖子 vickycq » 2016-05-29 22:55

尝试将 /var/lib/apt/lists/ 中的内容全部移除,再执行一次 apt update,再尝试安装所需软件包。

代码: 全选

sudo rm -r /var/lib/apt/lists/*
sudo apt update
狗尾草 写了:libc6-dev : Depends: libc6 (= 2.19-0ubuntu6.6) but 2.19-0ubuntu6.7 is to be installed
libc6-dev 的实际依赖为 libc6 (= 2.19-0ubuntu6.9)
http://packages.ubuntu.com/trusty/libc6-dev
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
头像
astolia
论坛版主
帖子: 6444
注册时间: 2008-09-18 13:11

Re: 安装build-essential失败,如何解决?

#3

帖子 astolia » 2016-05-30 15:38

163的源跟官方同步上感觉比不上aliyun及时
回复