g++ : 依赖: g++-9 (>= 9.3.0-3~) 但是它将不会被安装

因为动态链接库使用问题,需要使用g++11,所以升级了g++版本,造成原本的环境发生变化

#if using GCC compiler

cmake .. && make bgmg -j16

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++-9 (>= 9.3.0-3~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

解决方法

sudo apt autoremove

sudo apt install aptitude

sudo aptitude install build-essential

The following NEW packages will be installed:
  build-essential g++{a} g++-9{a} libc-dev-bin{a} libc6-dev{ab}
  libcrypt-dev{a} libstdc++-9-dev{a} linux-libc-dev{a}
0 packages upgraded, 8 newly installed, 0 to remove and 187 not upgraded.
Need to get 14.0 MB of archives. After unpacking 73.5 MB will be used.
The following packages have unmet dependencies:
 libc6-dev : Depends: libc6 (= 2.31-0ubuntu9.7) but 2.31-0ubuntu9.9 is installed
The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     build-essential [Not Installed]                    
2)     g++ [Not Installed]                                
3)     g++-9 [Not Installed]                              
4)     libc6-dev [Not Installed]                          
5)     libstdc++-9-dev [Not Installed]                    

Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:

     Downgrade the following packages:                                      
1)     libc6 [2.31-0ubuntu9.9 (now) -> 2.31-0ubuntu9.7 (focal-security)]    
2)     libc6-dbg [2.31-0ubuntu9.9 (now) -> 2.31-0ubuntu9.7 (focal-security)]

Accept this solution? [Y/n/q/?] Y
The following packages will be DOWNGRADED:
  libc6 libc6-dbg
The following NEW packages will be installed:
  build-essential g++{a} g++-9{a} libc-dev-bin{a} libc6-dev{a}
  libcrypt-dev{a} libstdc++-9-dev{a} linux-libc-dev{a}
0 packages upgraded, 8 newly installed, 2 downgraded, 0 to remove and 187 not upgraded.
Need to get 27.2 MB of archives. After unpacking 120 MB will be used.
Do you want to continue? [Y/n/?] Y
Get: 1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/main amd64 libcrypt-dev amd64 1:4.4.10-10ubuntu4 [104 kB]
Get: 2 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/main amd64 g++ amd64 4:9.3.0-1ubuntu2 [1,604 B]
Get: 3 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/main amd64 build-essential amd64 12.8ubuntu1 [4,624 B]
Get: 4 http://security.ubuntu.com/ubuntu focal-security/main amd64 libc6-dbg amd64 2.31-0ubuntu9.7 [10.5 MB]
Get: 5 http://security.ubuntu.com/ubuntu focal-security/main amd64 libc6 amd64 2.31-0ubuntu9.7 [2,714 kB]
Get: 6 http://security.ubuntu.com/ubuntu focal-security/main amd64 libc-dev-bin amd64 2.31-0ubuntu9.7 [71.6 kB]
Get: 7 http://security.ubuntu.com/ubuntu focal-security/main amd64 linux-libc-dev amd64 5.4.0-165.182 [1,112 kB]
Get: 8 http://security.ubuntu.com/ubuntu focal-security/main amd64 libc6-dev amd64 2.31-0ubuntu9.7 [2,518 kB]
Get: 9 http://security.ubuntu.com/ubuntu focal-security/main amd64 libstdc++-9-dev amd64 9.4.0-1ubuntu1~20.04.2 [1,722 kB]
Get: 10 http://security.ubuntu.com/ubuntu focal-security/main amd64 g++-9 amd64 9.4.0-1ubuntu1~20.04.2 [8,421 kB]
Fetched 27.2 MB in 6s (4,246 kB/s)                                              
Preconfiguring packages ...
                       
原文链接:https://blog.csdn.net/m0_61852405/article/details/133991588

关于g++连接库问题: version `GLIBC_2.34‘ not found-CSDN博客

  • 17
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值