正在学习<Exploring beagblone black>这本书。学习Multiarch这部分时,遇到了问题。我发现安装debain 18.04 bionic armhf源时,总是出错:
因为国内的源统统不支持armhf, 只支持amd64, i386。这个我已经按照askubuntu上的帖子测试过了: 链接
。
16个国内源都不行,包括alibaba, tsinghua tuna ... 链接: 链接
经过一些搜寻,发现如此安装,可以解决问题,并顺利运行:
sudo apt install libicu-dev:armhf
修改/etc/sources.list文件,增加:
# 这些旧源,只支持amd64和i386架构
deb [arch=amd64,i386] https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main res tricted universe multiverse
...
...
# 增加armhf的源
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports bionic main
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports bionic-updates main
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports bionic-security main
这样第三方的库文件及其依赖就都被安装在了 /usr/lib/arm-linux-gnueabihf/ 目录下面。
抄的查询armhf脚本
URLS="http://mirrors.cqu.edu.cn/ubuntu/ http://mirrors.dgut.edu.cn/ubuntu/ http://mirror.kumi.systems/ubuntu-ports/ http://mirror.lzu.edu.cn/ubuntu/ http://linux.xjtuns.cn/ubuntu/ http://mirrors.yun-idc.com/ubuntu/ http://mirrors.ustc.edu.cn/ubuntu/ http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ http://mirrors.sohu.com/ubuntu/ http://mirrors.njupt.edu.cn/ubuntu/ http://mirrors.nju.edu.cn/ubuntu/ http://mirrors.huaweicloud.com/repository/ubuntu/ https://mirrors.hit.edu.cn/ubuntu/ http://mirrors.cn99.com/ubuntu/ https://mirrors.bfsu.edu.cn/ubuntu/ http://ftp.sjtu.edu.cn/ubuntu/ http://mirrors.aliyun.com/ubuntu/ "
# URL of the Launchpad mirror list
MIRROR_LIST=https://launchpad.net/ubuntu/+archivemirrors
# Set to the architecture you're looking for (e.g., amd64, i386, arm64, armhf, armel, powerpc, ...).
# See https://wiki.ubuntu.com/UbuntuDevelopment/PackageArchive#Architectures
ARCH=armhf
# Set to the Ubuntu distribution you need (e.g., precise, saucy, trusty, ...)
# See https://wiki.ubuntu.com/DevelopmentCodeNames
DIST=bionic
# Set to the repository you're looking for (main, restricted, universe, multiverse)
# See https://help.ubuntu.com/community/Repositories/Ubuntu
REPO=main
# First, we retrieve the Launchpad mirror list, and massage it to obtain a newline-separated list of HTTP mirrors
#for url in $(curl -s $MIRROR_LIST | grep -Po 'http://.*(?=">http</a>)'); do
for url in $URLS ; do
# If you like some output while the script is running (feel free to comment out the following line)
echo "Processing $url ..."
# retrieve the header for the URL $url/dists/$DIST/$REPO/binary-$ARCH/; check if status code is of the form 2.. or 3..
curl -s --head $url/dists/$DIST/$REPO/binary-$ARCH/ | head -n 1 | grep -q "HTTP/1.[01] [23].."
# if successful, output the URL
[ $? -eq "0" ] && echo "FOUND: $url"
done
网友评论