简体   繁体   English

获取x64 Ubuntu主机上的arm开发库包?

[英]Get dev library packages for arm on x64 Ubuntu host?

I am building a project that requires a number of libraries, for windows I got prebuilt libs from MSYS2, for linux from the ubuntu repos, and now I am porting to android, so I need the same libraries for armhf and arm64 . 我正在构建一个需要大量库的项目,对于Windows,我从MSYS2获得了预构建的库,从ubuntu存储库中获得了Linux,现在我正在移植到android,因此我需要与armhfarm64相同的库。 The good news is the ubuntu repos have everything I need, the bad news - I can't figure out how to get them using apt , that is get the libs with the entire dependency trees. 好消息是ubuntu仓库拥有我需要的一切,坏消息-我不知道如何使用apt来获取它们,即获取具有整个依赖关系树的库。 It is possible to download individual packages from the web, but it gets kind of arduous to get the entire dependency tree, building the libraries from source - tremendously more so. 可以从Web上下载单个程序包,但是要获取整个依赖关系树并从源代码构建库会很费力-如此之多。

I can do sudo apt-get install package:uarch for i386 even though I am on a 64bit host, however when I try arm I get a unable to locate package . 即使我在64位主机上,我也可以为i386进行sudo apt-get install package:uarch ,但是当我尝试使用arm时,我unable to locate package So how do I get them? 那我怎么得到它们呢?


Note 1: I only need the libraries, I don't need toolchains, the NDK already has those. 注意1:我只需要库,不需要工具链,NDK已经有了那些。

Note 2: I did try asking on the ubuntu site, but I didn't get any feedback in like a day, and since the question is strictly about development I decided to try here. 注意2:我确实尝试在ubuntu网站上提问,但是一天之内都没有得到任何反馈,由于问题完全是关于开发的问题,所以我决定在这里尝试。

Note 3: The question is not about recommending libraries. 注意3:问题不在于推荐库。

EDIT: After dpkg --add-architecture armhf for update I get: 编辑: dpkg --add-architecture armhf更新后,我得到:

Hit:1 http://bg.archive.ubuntu.com/ubuntu xenial InRelease
Hit:3 http://bg.archive.ubuntu.com/ubuntu xenial-backports InRelease           
Get:2 http://bg.archive.ubuntu.com/ubuntu xenial-updates InRelease [95,7 kB]   
Ign:4 http://bg.archive.ubuntu.com/ubuntu xenial/main armhf Packages           
Ign:5 http://bg.archive.ubuntu.com/ubuntu xenial/restricted armhf Packages
Ign:6 http://bg.archive.ubuntu.com/ubuntu xenial/universe armhf Packages
Ign:7 http://bg.archive.ubuntu.com/ubuntu xenial/multiverse armhf Packages
Ign:4 http://bg.archive.ubuntu.com/ubuntu xenial/main armhf Packages
Ign:5 http://bg.archive.ubuntu.com/ubuntu xenial/restricted armhf Packages
Ign:6 http://bg.archive.ubuntu.com/ubuntu xenial/universe armhf Packages
Ign:7 http://bg.archive.ubuntu.com/ubuntu xenial/multiverse armhf Packages
Ign:4 http://bg.archive.ubuntu.com/ubuntu xenial/main armhf Packages     
Ign:5 http://bg.archive.ubuntu.com/ubuntu xenial/restricted armhf Packages
Ign:6 http://bg.archive.ubuntu.com/ubuntu xenial/universe armhf Packages 
Hit:8 http://security.ubuntu.com/ubuntu xenial-security InRelease        
Ign:7 http://bg.archive.ubuntu.com/ubuntu xenial/multiverse armhf Packages
Ign:9 http://bg.archive.ubuntu.com/ubuntu xenial-backports/main armhf Packages
Ign:10 http://bg.archive.ubuntu.com/ubuntu xenial-backports/universe armhf Packages
Err:4 http://bg.archive.ubuntu.com/ubuntu xenial/main armhf Packages
  404  Not Found [IP: 195.85.215.252 80]
Ign:5 http://bg.archive.ubuntu.com/ubuntu xenial/restricted armhf Packages
Ign:6 http://bg.archive.ubuntu.com/ubuntu xenial/universe armhf Packages
Ign:7 http://bg.archive.ubuntu.com/ubuntu xenial/multiverse armhf Packages
Ign:9 http://bg.archive.ubuntu.com/ubuntu xenial-backports/main armhf Packages
Ign:10 http://bg.archive.ubuntu.com/ubuntu xenial-backports/universe armhf Packages
Ign:9 http://bg.archive.ubuntu.com/ubuntu xenial-backports/main armhf Packages
Ign:10 http://bg.archive.ubuntu.com/ubuntu xenial-backports/universe armhf Packages
Get:11 http://bg.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [383 kB]
Get:12 http://bg.archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages [378 kB]
Ign:13 http://bg.archive.ubuntu.com/ubuntu xenial-updates/main armhf Packages  
Get:14 http://bg.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [323 kB]
Get:15 http://bg.archive.ubuntu.com/ubuntu xenial-updates/universe i386 Packages [320 kB]
Ign:16 http://bg.archive.ubuntu.com/ubuntu xenial-updates/universe armhf Packages
Ign:17 http://bg.archive.ubuntu.com/ubuntu xenial-updates/multiverse armhf Packages
Err:9 http://bg.archive.ubuntu.com/ubuntu xenial-backports/main armhf Packages
  404  Not Found [IP: 195.85.215.252 80]
Ign:10 http://bg.archive.ubuntu.com/ubuntu xenial-backports/universe armhf Packages
Ign:13 http://bg.archive.ubuntu.com/ubuntu xenial-updates/main armhf Packages
Ign:16 http://bg.archive.ubuntu.com/ubuntu xenial-updates/universe armhf Packages
Ign:17 http://bg.archive.ubuntu.com/ubuntu xenial-updates/multiverse armhf Packages
Ign:13 http://bg.archive.ubuntu.com/ubuntu xenial-updates/main armhf Packages
Ign:16 http://bg.archive.ubuntu.com/ubuntu xenial-updates/universe armhf Packages
Ign:17 http://bg.archive.ubuntu.com/ubuntu xenial-updates/multiverse armhf Packages
Err:13 http://bg.archive.ubuntu.com/ubuntu xenial-updates/main armhf Packages
  404  Not Found [IP: 195.85.215.252 80]
Ign:16 http://bg.archive.ubuntu.com/ubuntu xenial-updates/universe armhf Packages
Ign:17 http://bg.archive.ubuntu.com/ubuntu xenial-updates/multiverse armhf Packages
Ign:18 http://security.ubuntu.com/ubuntu xenial-security/main armhf Packages
Ign:19 http://security.ubuntu.com/ubuntu xenial-security/universe armhf Packages
Ign:18 http://security.ubuntu.com/ubuntu xenial-security/main armhf Packages
Ign:19 http://security.ubuntu.com/ubuntu xenial-security/universe armhf Packages
Ign:18 http://security.ubuntu.com/ubuntu xenial-security/main armhf Packages
Ign:19 http://security.ubuntu.com/ubuntu xenial-security/universe armhf Packages
Err:18 http://security.ubuntu.com/ubuntu xenial-security/main armhf Packages
  404  Not Found [IP: 91.189.91.26 80]
Ign:19 http://security.ubuntu.com/ubuntu xenial-security/universe armhf Packages
Fetched 95,7 kB in 1s (59,8 kB/s)
Reading package lists... Done
E: Failed to fetch http://bg.archive.ubuntu.com/ubuntu/dists/xenial/main/binary-armhf/Packages  404  Not Found [IP: 195.85.215.252 80]
E: Failed to fetch http://bg.archive.ubuntu.com/ubuntu/dists/xenial-backports/main/binary-armhf/Packages  404  Not Found [IP: 195.85.215.252 80]
E: Failed to fetch http://bg.archive.ubuntu.com/ubuntu/dists/xenial-updates/main/binary-armhf/Packages  404  Not Found [IP: 195.85.215.252 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/main/binary-armhf/Packages  404  Not Found [IP: 91.189.91.26 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.

Unlike Debian, the Ubuntu archives don't have everything in the right place already, in fact non-x86 packages are kept somewhere else altogether. 与Debian不同,Ubuntu档案库中的所有内容都没有放在正确的位置,实际上,非x86软件包完全放在其他位置。 The first thing to do is edit /etc/apt/sources.lst to add ports.ubuntu.com alongside archive.ubuntu.com/ubuntu for the repositories you want, eg for: 首先要做的是编辑/etc/apt/sources.lst,在想要的存储库的旁边添加ports.ubuntu.com和archive.ubuntu.com/ubuntu,例如:

deb http://bg.archive.ubuntu.com/ubuntu/ xenial main restricted

the equivalent ports repo is: 等效端口回购是:

deb http://bg.ports.ubuntu.com/ xenial main restricted

With those in place, 有了这些,

dpkg --add-architecture armhf

(repeat as appropriate for additional architectures), then updating as usual, does the trick. (针对其他体系结构进行适当的重复),然后照常进行更新即可解决问题。 I've confirmed this on a fresh install of 16.04.1, but I'm pretty sure the same applies as far back as 12.04 too. 我已经在16.04.1的全新安装中确认了这一点,但是我敢肯定,最早在12.04之前也是如此。

Per the multiarch documentation , you can shut the "ignored" and "not found" errors up by restricting entries to the relevant architectures, ie: 根据多体系结构文档 ,您可以通过将条目限制在相关体系结构中来关闭“忽略”和“未找到”错误,即:

deb [arch=i386,amd64] http://archive.ubuntu.com...
deb [arch=armhf] http://ports.ubuntu.com...

For reference, Debian's census report has a convenient summary. 作为参考, Debian的人口普查报告中有一个方便的摘要。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM