树莓派(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
相关推荐
Lester_11014 天前
STM32霍尔传感器输入口设置为复用功能输入口时,还能用GPIO函数直接读取IO的状态吗
stm32·单片机·嵌入式硬件·电机控制
LCG元4 天前
低功耗显示方案:STM32L0驱动OLED,动态波形绘制与优化
stm32·嵌入式硬件·信息可视化
三佛科技-187366133974 天前
120W小体积碳化硅电源方案(LP8841SC极简方案12V10A/24V5A输出)
单片机·嵌入式硬件
z20348315204 天前
STM32F103系列单片机定时器介绍(二)
stm32·单片机·嵌入式硬件
Alaso_shuang5 天前
STM32 核心输入、输出模式
stm32·单片机·嵌入式硬件
脚后跟5 天前
AI助力嵌入式物联网项目全栈开发
嵌入式硬件·物联网·ai编程
2501_918126915 天前
stm32死锁是怎么实现的
stm32·单片机·嵌入式硬件·学习·个人开发
星马梦缘5 天前
驱动层开发——蜂鸣器驱动
stm32·单片机·嵌入式硬件·hal·驱动
小刘爱玩单片机5 天前
【stm32简单外设篇】- 测速传感器模块(光电)
c语言·stm32·单片机·嵌入式硬件
电化学仪器白超5 天前
EC20CEHDLG-128-SNNS调试记录
python·单片机·嵌入式硬件·自动化