AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1061979
Accepted
psiphi75
psiphi75
Asked: 2018-08-04 02:01:35 +0800 CST2018-08-04 02:01:35 +0800 CST 2018-08-04 02:01:35 +0800 CST

交叉编译 armhf 并安装静态库

  • 772

我已经设置了一个交叉编译的 docker 实例。简而言之,我开始设置

apt-get update
apt-get install binutils-multiarch

dpkg --add-architecture armhf
# Manually add correct armhf repositories to /etc/apt/sources.list
apt-get update
apt-get install libudev-dev:armhf

在这最后一步中,我收到以下错误:

The following packages have unmet dependencies:
libudev-dev:armhf : Depends: libacl1:armhf (>= 2.2.51-8) but it is not going to be installed
                    Depends: libblkid1:armhf (>= 2.19.1) but it is not going to be installed
                    Depends: libc6:armhf (>= 2.17) but it is not going to be installed
                    Depends: libgcc1:armhf (>= 1:3.5) but it is not going to be installed
                    Depends: libkmod2:armhf (>= 5~) but it is not going to be installed
                    Depends: libselinux1:armhf (>= 2.0.65) but it is not going to be installed
                    Depends: libudev1:armhf (= 229-4ubuntu4) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

手动安装这些不是一个选项,因为libc6:armhf与当前安装的 amd64 libc6 冲突并且最终会覆盖这个包。我只想设置libudev:armhf包以便我可以链接到它。

/etc/apt/sources.list:

deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ xenial main restricted
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted

deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted

deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ xenial universe
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ xenial-updates universe

deb [arch=amd64] http://security.ubuntu.com/ubuntu/ xenial-security main restricted
deb [arch=amd64] http://security.ubuntu.com/ubuntu/ xenial-security universe
deb [arch=amd64] http://security.ubuntu.com/ubuntu/ xenial-security multiverse

运行apt-cache policy libudev-dev:{amd64,armhf}输出以下内容:

libudev-dev:
  Installed: (none)
  Candidate: 229-4ubuntu21.4
  Version table:
     229-4ubuntu21.4 500
        500 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
     229-4ubuntu21.1 500
        500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
     229-4ubuntu4 500
        500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages
libudev-dev:armhf:
  Installed: (none)
  Candidate: 229-4ubuntu4
  Version table:
     229-4ubuntu4 500
        500 http://ports.ubuntu.com/ubuntu-ports xenial/main armhf Packages
compiling arm cross-compilation
  • 1 1 个回答
  • 6668 Views

1 个回答

  • Voted
  1. Best Answer
    Olimjon
    2018-08-09T17:53:25+08:002018-08-09T17:53:25+08:00

    第 1 步 - 打开终端:

    按Ctrl+ Alt+ T。

    第 2 步 - 备份:

    执行:

    sudo cp /etc/apt/sources.list /etc/apt/sources.list.old
    

    第 3 步 - 打开编辑器:

    执行:

    sudo gedit /etc/apt/sources.list
    

    如果需要,您可以使用其他编辑器。

    第 4 步 - 编辑sources.list:

    删除此处的所有内容并添加以下内容:

    deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ xenial main multiverse restricted universe
    deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ xenial main multiverse restricted universe
    deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main multiverse restricted universe
    deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ xenial-updates main multiverse restricted universe
    deb [arch=amd64] http://security.ubuntu.com/ubuntu/ xenial-security main multiverse restricted universe
    

    保存并退出。

    第 5 步 - 更新您的存储库索引:

    执行:

    sudo apt update
    

    libudev-dev第6 步 - 安装armhf架构:

    执行:

    sudo apt install libudev-dev:armhf
    

    澄清: Multiarch 软件包需要在所有架构上安装相同的版本。因此,您应该有libudev-dev:armhfwith version 229-4ubuntu21.4,但您当前的存储库配置不包括此版本。因此,您应该添加xenial-updates支持此版本的行。

    关于其他建议添加频道,我建议您添加这些以防出现问题。

    • 6

相关问题

  • 我可以在不重新编译源代码的情况下重建包吗?

  • 如何在没有 sudo 权限的情况下构建应用程序?

  • 为 i7 处理器编译内核的最佳方法是什么?

  • 如何将具有依赖项的包上传到我的 PPA?

  • 如何让 .so 文件显示在包中?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve