windows 10 自带的 ubuntu 安装 g++ 遇到的问题Depends: g++

发布时间:2024-12-24 05:20

在阅读时配乐:巴赫的《Air on G String》 #生活乐趣# #生活分享# #音乐推荐#

 windows 10 自带 ubuntu 版本 

No LSB modules are available.

Distributor ID: Ubuntu

Description: Ubuntu 16.04.2 LTS

Release: 16.04

Codename: xenial

sudo apt-get install g++

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:

g++ : Depends: g++-4.8 (>= 4.8.2-5~) but it is not going to be installed

E: Unable to correct problems, you have held broken packages.

下面把我解决这个问题遇到的所有解法都列一下,方便后面遇到相同问题的人填坑.

1.卸载掉装的4.8版本的gcc, 重新安装5

sudo add-apt-repository ppa:ubuntu-toolchain-r/test

sudo apt-get update

sudo apt-get install gcc-5 g++-5

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5

这个行不通,第三步报错

The following packages have unmet dependencies:

g++-5 : Depends: libstdc++-5-dev (= 5.5.0-12ubuntu1~16.04) but it is not going to be installed

Depends: libisl15 (>= 0.15) but it is not installable

gcc-5 : Depends: cpp-5 (= 5.5.0-12ubuntu1~16.04) but it is not going to be installed

Depends: binutils (>= 2.26.1) but 2.24-5ubuntu14.2 is to be installed

Depends: libisl15 (>= 0.15) but it is not installable

Recommends: libc6-dev (>= 2.13-0ubuntu6) but it is not going to be installed

E: Unable to correct problems, you have held broken packages.

看了一下apt-get的原理, 他应该自动搞定所有依赖包, 但是由于源里面的版本啥的问题导致包不对也无法搞定自动安装, 所以换个源试试

换清华大学的源

https://blog.csdn.net/paincupid/article/details/52895676

还是报错 E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

换山东大学的源

还是报错

The following packages have unmet dependencies:
 g++-5 : Depends: libstdc++-5-dev (= 5.5.0-12ubuntu1~16.04) but it is not going to be installed
 gcc-5 : Depends: binutils (>= 2.26.1) but 2.24-5ubuntu14.2 is to be installed
         Recommends: libc6-dev (>= 2.13-0ubuntu6) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

换阿里的源

E: Failed to fetch http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu/pool/main/g/gcc-5/cpp-5_5.5.0-12ubuntu1~16.04_amd64.deb  Hash Sum mismatch

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

更新一下

apt-get update --fix-missing

重新安装, 提示安装过了

sudo apt-get install gcc-5 g++-5

sudo apt-get install gcc-5 g++-5

Reading package lists... Done

Building dependency tree

Reading state information... Done

g++-5 is already the newest version (5.5.0-12ubuntu1~16.04).

gcc-5 is already the newest version (5.5.0-12ubuntu1~16.04).

The following packages were automatically installed and are no longer required:

gcc-4.8 libasan0 libgcc-4.8-dev libplymouth2

Use 'sudo apt autoremove' to remove them.

0 upgraded, 0 newly installed, 0 to remove and 260 not upgraded.

安装node js , 提醒还是找不到g++

https://www.cnblogs.com/tianhei/p/7430050.html 安装nodejs 教程

make[1]: g++: Command not found

make[1]: *** [/root/node-v6.11.2/out/Release/obj.target/icuucx/deps/icu-small/source/common/appendable.o] Error 127

make[1]: Leaving directory `/root/node-v6.11.2/out'

make: *** [node] Error 2

然后再执行一下 apt-get install gcc 重新安装了

执行 apt-get install g++ 也重新安装了,还提示成功了.然后nodejs可以开始make了

也就是说 , 本质原因还是源的问题

网址:windows 10 自带的 ubuntu 安装 g++ 遇到的问题Depends: g++ https://www.yuejiaxmz.com/news/view/551094

相关内容

NO(g)+CO(g)=1/2N 2 (g)+CO 2 (g) Δ r H m
消除含氮化合物对大气和水体的污染是环境保护的重要研究课题。(1)已知:反应ⅠN2(g)+O2(g)=2NO(g)ΔH=akJ·mol-1反应Ⅱ2NO(g)+O2
瞬间清理几个G 手机瞬间清理出10个g
已知在298K时反应2N2(g)+O2(g)=2N2O(g)的△U为166.5k
GRICOL G
低碳经济呼唤新能源和清洁环保能源.煤化工中常需研究不同温度下的平衡常数.投料比及热值等问题.已知:CO(g) + H2O(g)H2(g) + CO2(g) △H= a kJ·mol
氨和肼(N2H4)是氮的两种常见化合物.在科学技术和生产中有广泛应用.回答下列问题:(l)已知:N2(g)+3H2(g)?2NH3(g)△H=
丙烯是重要的有机化工原料,丙烷脱氢制丙烯具有显著的经济价值和社会意义。回答下列问题:(1)已知:I.2C3H8(g)+O2(g)=2C3H6(g)+2H2O(g
已知反应:mA(g)+nB(g)=pC(g)+qD(g),当压缩体积使体系总压力
对反应N2H4(g) + O2(g) =N2(g) + 2H2O(l)来说,ΔH

随便看看