树莓派换源

查询自己版本:

lsb_release -a

bullseye可以理解为树莓派的系统代号(10,11,12都不同,一定要看好自己系统是什么版本)

查询架构

uname -a

aarch64的地方就是代表系统架构的,我的是aarch64的架构。

完成上面就可以去清华源网站查找自己对应的清华源了。

查找树莓派源:mirrors.tuna.tsinghua.edu.cn/help/debian/

可以得到源:

复制代码
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
 
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
 
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
 
deb https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
deb-src https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware

然后打开控制台输入下面命令:

复制代码
sudo nano /etc/apt/sources.list

进入该文件编辑,将里面的内容用清华源的内容覆盖掉,保存退出。(Ctrl+X键入Y,回车保存)

最后:sudo apt-get update && sudo apt-get upgrade

可能会报错:no public key available

解决问题(更换源之后添加公钥即可),执行以下命令:
复制代码
gpg --keyserver  keyserver.ubuntu.com --recv-keys E77FC0EC34276B4B
gpg --export --armor E77FC0EC34276B4B | sudo apt-key add -
另一种解决方法(更换源之后添加公钥即可,推荐用这个命令),执行以下命令:
复制代码
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E77FC0EC34276B4B
相关推荐
西红柿维生素3 分钟前
23种设计模式-框架中的使用
java·开发语言·设计模式
LNN20225 分钟前
Qt creator +Valgrind检测内存泄漏(linux)
linux·开发语言·qt
修炼前端秘籍的小帅38 分钟前
精读《JavaScript 高级程序设计 第4版》第6章 集合引用类型(三)Map、WeakMap、Set、WeakSet
开发语言·javascript·ecmascript
@LetsTGBot搜索引擎机器人1 小时前
打造属于你的 Telegram 中文版:汉化方案 + @letstgbot 搜索引擎整合教程
开发语言·python·搜索引擎·机器人·.net
人工智能的苟富贵1 小时前
使用 Tauri + Rust 构建跨平台桌面应用:前端技术的新边界
开发语言·前端·rust·electron
j_xxx404_1 小时前
C++ STL:string类(3)|operations|string类模拟实现|附源码
开发语言·c++
GHZero2 小时前
Java 之解读String源码(九)
java·开发语言
Swift社区2 小时前
Lombok 不生效 —— 从排查到可运行 Demo(含实战解析)
java·开发语言·安全
南清的coding日记2 小时前
Java 程序员的 Vue 指南 - Vue 万字速览(01)
java·开发语言·前端·javascript·vue.js·css3·html5
@大迁世界2 小时前
我用 Rust 重写了一个 Java 微服务,然后丢了工作
java·开发语言·后端·微服务·rust