Fork me on GitHub

树莓派更改APT为国内阿里云源

目录

  • 背景

  • 第一部分 更改步骤

  • 参考文献及资料

背景

发现树莓派wget国外源异常慢。其实可以更改为国内的apt源,不用走海下光缆啦。

第一部分 更改步骤

1.1 编辑sources.list文件

还没安装我喜爱的vim,只能先用nano编辑文件:

1
root@raspberrypi:~# nano /etc/apt/sources.list

1.2 修改源

将原始的源注释掉,添加阿里云的源地址(在这里感谢阿里爸爸)。

1
2
deb http://mirrors.aliyun.com/raspbian/raspbian/ jessie main non-free contrib rpi
deb-src http://mirrors.aliyun.com/raspbian/raspbian/ jessie main non-free contrib rpi

1.3 更软件索引清单

最后更新一下,以后就可以快速apt-get啦。

1
sudo apt-get update

第二部分 更换清华源

首先通过 uname -m 确定你使用的系统的架构

1
2
3
4
5
vi /etc/apt/sources.list

# armv7l 用户:编辑 `/etc/apt/sources.list` 文件,删除原文件所有内容,用以下内容取代
deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ bullseye main non-free contrib rpi
deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ bullseye main non-free contrib rpi

参考文献及资料

1、Raspberry Pi 使用阿里云OPSX镜像,链接:https://zihengcat.github.io/2018/05/14/using-alibaba-cloud-opsx-mirrors-in-raspberry-pi/

本文标题:树莓派更改APT为国内阿里云源

文章作者:rong xiang

发布时间:2018年03月01日 - 19:03

最后更新:2022年10月25日 - 23:10

原始链接:https://zjrongxiang.github.io/posts/72ed4d3e/

许可协议: 署名-非商业性使用-禁止演绎 4.0 国际 转载请保留原文链接及作者。

0%