问题背景

在64位Linux操作系统的主机上安装32位的交叉编译链时,如果64位系统与32位的工具链不兼容,在我们使用工具链对代码进行交叉编译时,往往会出现明明工具链已经安装到了指定的目录下,环境变量也都设置好了,而系统却依旧提示与arm-XXX-linux-gnueabi-g++: error while loading shared libraries:libXXXXX.so.n: cannot open shared object file: no such file or directory类似的错误。

问题描述

想要让系统32-bit的交叉编译工具链正常工作,就需要安装lib32z1、lib32ncurses5、lib32stdc++6这几个兼容包。但是如果自己的系统里的libc6的版本比较高的话,在执行安装这几个兼容包时可能会出现类似下面的问题:

lch@ThinkPad:~$ sudo apt install lib32z1 lib32ncurses5 lib32stdc++6
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:lib32ncurses5 : Depends: lib32tinfo5 (= 6.0+20160213-1ubuntu1) but it is not going to be installedDepends: libc6-i386 (>= 2.4) but it is not going to be installedlib32stdc++6 : Depends: lib32gcc1 (>= 1:4.2) but it is not going to be installedDepends: libc6-i386 (>= 2.18) but it is not going to be installedlib32z1 : Depends: libc6-i386 (>= 2.4) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

这里也许不太能看出这些包对libc6的版本依赖,我们再执行一下依赖包libc6-i386的安装,从提示可以明显看出libc6-i386依赖于2.23-0ubuntu11版本的libc6,而我的系统里libc6的版本为2.27-3ubuntu1。

lch@ThinkPad:~$ sudo apt-get install libc6-i386
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:libc6-i386 : Depends: libc6 (= 2.23-0ubuntu11) but 2.27-3ubuntu1 is to be installed
E: Unable to correct problems, you have held broken packages.

系统中libc6的版本

解决办法

针对这种情况,有两种解决办法:

1. 将自己系统里的libc6版本降级为2.23,对于操作系统里的各种部件不是十分熟悉的我来说这种方法的风险略大,一个不小心系统可能会崩在我的手里,稳妥起见,不考虑这种方案。

2. 直接安装与libc6_2.27-3ubuntu1版本匹配的软件包,即直接在网上寻找版本匹配的deb包。

下载地址链接:Packages for Linux and Unix - pkgs.org

网站界面

进入网页搜索所需的软件包,根据页面提示的软件包的版本及依赖关系下载相应的软件包并安装。要解决上述安装lib32z1、lib32ncurses5、lib32stdc++6安装过程中出现的问题,需要下载并安装下列软件包:

libc6-dev-i386_2.27-3ubuntu1_amd64.deb
libc6-i386_2.27-3ubuntu1_amd64.deb
gcc-8-base_8-20180414-1ubuntu2_amd64.deb
lib32gcc1_8-20180414-1ubuntu2_amd64.deb
lib32ncurses5_6.1-1ubuntu1_amd64.deb
lib32stdc++6_8-20180414-1ubuntu2_amd64.deb
lib32tinfo5_6.1-1ubuntu1_amd64.deb
lib32z1_1.2.11.dfsg-0ubuntu2_amd64.deb

注:网站上Ubuntu 16.04的软件包对应的libc6的版本是2.23,我需要安装的是2.27的,因而直接下载对应于2.27-3ubuntu1版本的Ubuntu 18.04的软件包,版本和依赖关系对应即可。

安装之后查看交叉编译链版本,如打印出其详细的版本信息,说明成功解决。

32位兼容包安装成功之后的交叉编译链打印的版本信息示例

“lib32ncurses5 : Depends: libc6-i386 (>= 2.18) but it is not going to be installed”类似问题解决办法相关推荐

  1. The following packages have unmet dependencies: deepin.com.wechat:i386 : Depends: deepin-wine:i386

    系统之前装过微信,安装gitk时报错: Heisenberg海森堡:~$ sudo apt-get -f install gitk Reading package lists... Done Buil ...

  2. ubuntu12.04安装libgl1-mesa-glx:i386问题解决办法

    sudo install apt-get libgl1-mesa-glx:i386时,提示有未满足的依赖关系,说是依赖libglapi-mesa:i386 ,但是在安装libglapi-mesa:i3 ...

  3. git clone: error:RPC failed;result=18,HTTP code = 200 MiB | 2.00 KiB/s解决办法

    在windows上git clone时,出现 error: RPC failed; result=18, HTTP code = 200 MiB | 2.00 KiB/s fatal: The rem ...

  4. mysql proxies priv_Mysql 5.7.18 利用 MySQL proxies_priv(模拟角色)实现类似用户组管理...

    利用MySQL proxies_priv(模拟角色)实现类似用户组管理 角色(Role)可以用来批量管理用户,同一个角色下的用户,拥有相同的权限. MySQL5.7.X以后可以模拟角色(Role)的功 ...

  5. ubuntu 18.04 server安装CIAO时出现ds9错误的解决办法

    报错如下: ......path-to-ciao/ots/lib/libtinfo.so.5: no version information available ...... 解决办法: 复制libt ...

  6. ubuntu18 遇到libc6 版本冲突问题

    问题描述:You might want to run 'apt --fix-broken install' to correct these. The following packages have ...

  7. 1、Ubuntu下安装软件报错

    今天在ubuntu下安装任何软件都提示以下错误: ideallic@ubuntu:~$ sudo apt-get install git [sudo] password for ideallic: R ...

  8. linux samba安装失败,用aptitude安装samba失败

    版本:You are using Ubuntu 10.04 LTS - the Lucid Lynx - released in April 2010 and supported until Apri ...

  9. ubuntu20.04 安装 DevStack

    DevStack Quick Start 官方文档 启动一个实例操作文档-中文 启动一个实例操作文档-英文 DevStack 一键安装,看起来很美!也许是咱国内网络环境受限造成各种不适,官方文档说大概 ...

最新文章

  1. linux kernel list_head
  2. 技术图文:如何在CSDN上写自己的技术Blog?
  3. 转】用Maven构建Mahout项目
  4. VLAN,trunk,以太网通道
  5. 我决定开发自己的第一款iPhone应用
  6. 域控 正在应用计算机设置,域控制器下发的用户组策略在ou内的用户上没有应用...
  7. FFmpeg 和自由软件社区的更新
  8. SAP UI5 数据绑定中的工厂函数
  9. 帝国 loginjs.php,帝国cms 6.6 后台拿shell
  10. 前端学习(1081):构造函数和原型概述
  11. loadrunner:关联操作
  12. HanLP: Han Language Processing
  13. Luogu3381【模板】最小费用最大流
  14. mysql编写触发器语法_mysql触发器语法
  15. 经纬度坐标转像素坐标
  16. 育碧首款区块链游戏真的来了吗?
  17. 处理不连续单元格,如sum,sumif,countif
  18. pyecharts对于经纬度_echarts 根据经纬度坐标在地图上描点
  19. 分享一个特别好用的站长在线工具箱
  20. oracle12c 兼容,12c(oracle12c兼容11g吗)

热门文章

  1. HydroD 实用教程(三)环境数据
  2. 输电线路的继电保护整定计算及装置
  3. jsp+左间距_jsp 中padding 与margin的区别
  4. python命令数字雨_用Python实现黑客帝国代码雨效果(3种方式)
  5. ATI F/T Gamma sensor( 力和力矩传感器 ) 开箱测评 + 使用说明
  6. sn9c269松翰_Encoding - 松翰科技 :: Sonix Technology Co., Ltd. :: SN9C291B
  7. 【财务危机】--2018.11债务
  8. Mac安装JDK1.8详细教程
  9. kettle学习笔记
  10. EtherCAT与RTEX驱动器轴回零的配置与实现