apt-get install build-essential Depends: libc6-dev but it is not going to be installed

ubuntu17 默认没有安装gcc的

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

 

------------安装aptitude 替换apt-get

[root]apt-get install aptitude

[root]aptitude install build-essential

一路选择“n”

发现按n显示的都是一样,说明到最后一步了

然后选择“Y", 再“Y”

---验证

[root] apt-get  install build-essential

Reading package lists... Done
Building dependency tree       
Reading state information... Done
build-essential is already the newest version (12.1ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 29 not upgraded.

成功了

 

你可能感兴趣的:(ubunt)