树莓派(ARM64 架构)Ubuntu 24.04 (Noble) 系统 `apt update` 报错解决方案

以下是针对树莓派(ARM64 架构)Ubuntu 24.04 (Noble) 系统 apt update 报错的最终解决方案总结:


问题原因

  1. 初始错误 (Transaction was already aborted):APT 缓存损坏或镜像源同步问题
  2. 后续错误 (404 Not Found for binary-arm64):ARM64 架构误用了仅支持 AMD64 的 ubuntu 镜像源

最终解决方案

步骤 1:备份原配置

bash 复制代码
sudo cp /etc/apt/sources.list.d/ubuntu.sources /etc/apt/sources.list.d/ubuntu.sources.bak

步骤 2:修改为 ARM64 适用的 Ubuntu Ports 国内源

bash 复制代码
sudo tee /etc/apt/sources.list.d/ubuntu.sources << 'EOF'
Types: deb
URIs: http://mirrors.aliyun.com/ubuntu-ports/
Suites: noble noble-updates noble-backports
Components: main universe restricted multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

Types: deb-src
URIs: http://mirrors.aliyun.com/ubuntu-ports/
Suites: noble-backports noble-updates noble noble-security
Components: main universe restricted multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

Types: deb
URIs: http://mirrors.aliyun.com/ubuntu-ports/
Suites: noble-security
Components: main universe restricted multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
EOF

步骤 3:清理缓存并更新

bash 复制代码
sudo rm -rf /var/lib/apt/lists/*
sudo apt clean
sudo apt update

关键要点

项目 说明
适用架构 ARM64 / aarch64(树莓派、ARM 服务器等)
镜像源关键区别 必须使用 ubuntu-ports 而非 ubuntu
推荐国内镜像 阿里云 mirrors.aliyun.com/ubuntu-ports/
其他可选镜像 清华 mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/、中科大 mirrors.ustc.edu.cn/ubuntu-ports/

验证命令

bash 复制代码
# 确认系统架构
dpkg --print-architecture  # 应输出: arm64

# 确认 apt 正常工作
sudo apt update && sudo apt upgrade -y
相关推荐
女神下凡12 小时前
芯参谋(119):凌阳(Sunplus)_开发指南
linux·arm开发·stm32·单片机·嵌入式硬件
Brilliantwxx2 天前
【STM32】 DAC 数模转换器(理论 + 外设 + 四个实验案例)
笔记·stm32·单片机·嵌入式硬件
无敌贵点大王2 天前
从寄存器层面重学STM32(15)——IIC理论
stm32·单片机·嵌入式硬件
en.en..2 天前
STM32 HAL 库 | 外设双结构体机制(外设句柄结构体+外设初始化结构体)
stm32·单片机·嵌入式硬件
元器件BOM超人3 天前
ATMEGA32A-AU TQFP-44 Microchip 8位AVR MCU 选型指南
单片机·嵌入式硬件
en.en..3 天前
STM32 GPIO 复用功能寄存器 AFRL/AFRH 原理
单片机·嵌入式硬件
shimly1234563 天前
(done) 野火嵌入式 (16) STM32中断应用概览
stm32·单片机·嵌入式硬件
橘为己有4413 天前
STM32:SPI(1)
stm32·单片机·嵌入式硬件
en.en..3 天前
STM32 定时器 | 输入捕获单元与输出比较单元
单片机·嵌入式硬件
倔强的胡萝卜3 天前
基于STM32F103C8T6的计算器设计(二)
stm32·单片机·嵌入式硬件