You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 20.04(Focal)ARM交叉编译环境下安装OpenSSL 1.1.1的脚本修改方案咨询

Ubuntu 20.04(Focal)ARM交叉编译环境下安装OpenSSL 1.1.1的脚本修改方案咨询

Hey there! Let's sort out how to get OpenSSL 1.1.1 installed instead of the 3.0.2 version in your ARM cross-compilation setup on Ubuntu 20.04 Focal.

First, a quick note: Ubuntu 20.04 Focal's official armhf ports repo actually ships OpenSSL 1.1.1 by default—3.0.x is the default for newer releases like 22.04 Jammy. The issue you're seeing is likely missing multiarch configuration (since you're installing armhf packages in an amd64 chroot) or a minor misstep in your script. Here's how to fix it:

Key modifications to your script

  1. Add chroot execution wrapper: Your original commands need to run inside the target ARM root filesystem, not directly on your x86 host.
  2. Enable multiarch support: Required to install packages for different architectures within the same chroot environment.
  3. Explicitly specify OpenSSL 1.1.1 version: Ensures you pull the correct branch instead of unexpected updates.

Here's the full revised script:

# Create the amd64 chroot base for cross-compilation
sudo debootstrap --arch=amd64 --variant=buildd focal /srv/armRoot

# Execute commands inside the chroot environment
sudo chroot /srv/armRoot << EOF
# Configure apt sources for both amd64 and armhf architectures
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu focal main universe" > /etc/apt/sources.list
echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports focal main universe" >> /etc/apt/sources.list
echo "deb-src http://archive.ubuntu.com/ubuntu focal main universe" >> /etc/apt/sources.list

# Enable multiarch support for armhf packages
dpkg --add-architecture armhf
apt-get update

# Install the latest patched version of OpenSSL 1.1.1 for armhf
apt-get install -y openssl:armhf=1.1.1* libssl-dev:armhf=1.1.1*
EOF

Extra tips

  • If you want to use a specific patched 1.1.1 version, first run this command inside the chroot to list available options:
    apt-cache madison openssl:armhf
    
    Then replace the wildcard 1.1.1* with the exact version string (e.g., 1.1.1f-1ubuntu2.20).
  • Double-check your sources.list doesn't include non-Focal repos—this is a common cause of pulling in unintended newer package versions.

备注:内容来源于stack exchange,提问作者Karma Yogi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.23 08:15:30