树莓派Ubuntu换源不能安装软件,提示mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/jammy/main/binary-arm64/Packages 404

问题描述

我给树莓派安装了ROS后,需要换源。我用了清华源,我在/etc/apt/sources.list里写入:

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-backports main restricted universe multiverse

# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
deb http://security.ubuntu.com/ubuntu/ noble-security main restricted universe multiverse
# deb-src http://security.ubuntu.com/ubuntu/ noble-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-proposed main restricted universe multiverse
# # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-proposed main restricted universe multiverse

结果换源之后update,upgrade,以及apt-get install xxx全都报错,报错如下:

E: Failed to fetch https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/jammy-updates/main/binary-arm64/Packages  404  Not Found [IP: 101.6.15.130 443]

原因

原因很简单,换源时疏忽了,清华源官网界面写着
树莓派是arm架构
我们的树莓派是arm架构,而这个仓库不包含arm架构的软件包

解决方案

图片里也写了解决方案,要使用ubuntu-port源链接)。
进入网站(链接),找到合适版本。
在这里插入图片描述
选择版本后复制里面的链接。
我们更改源,打开配置文件:

sudo nano /etc/apt/sources.list

在里面粘贴你对应版本的源,问题解决。
然后更新软件包,观察输出已经正常了。

sudo apt-get update
sudp apt-get upgrade 
// 此步第一次一般时间比较长
  • 10
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值