前言
因为树莓派官方源在国外,获取速度非常的慢,所以为了方便快速的获取,需要在烧录好系统后,将树莓派官方源换成国内源。
提示:以下是本篇文章正文内容,下面方法仅供参考
一、更换步骤
1. 备份原始源文件
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
2. 编辑软件源文件
sudo nano /etc/apt/sources.list
- 将初始的源使用#注释掉,添加如下两行镜像源:
- 清华源:
deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main contrib non-free rpi
deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main contrib non-free rpi
- 阿里源
deb https://mirrors.aliyun.com/raspbian/raspbian/ buster main non-free contrib
deb-src https://mirrors.aliyun.com/raspbian/raspbian/ buster main non-free contrib
3. 编辑系统源文件
sudo nano /etc/apt/sources.list.d/raspi.list
- 将初始的源使用#注释掉,添加如下两行清华的镜像源:
deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui
deb-src http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui
4. 更换pip源
- 先创建文件夹:
mkdir ~/.pip
- 再创建这个文件:
nano ~/.pip/pip.conf
- 在里面添加如下内容:
[global]
timeout =6000
index-url =http://pypi.douban.com/simple/
[install]
use-mirrors =true
mirrors =http://pypi.douban.com/simple/
trusted-host =pypi.douban.com
5. 最后更新源
sudo apt-get update
sudo apt-get upgrade
二、其它国内源列表
以前搜集的,不知道现在是否还好用。
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣 http://pypi.douban.com/simple
Python官方 https://pypi.python.org/simple/
v2ex http://pypi.v2ex.com/simple/
中国科学院 http://pypi.mirrors.opencas.cn/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
大连东软信息学院 http://mirrors.neusoft.edu.cn/raspbian/raspbian
浙江大学 http://mirrors.zju.edu.cn/raspbian/raspbian/
中国科学院开源软件协会 http://mirrors.opencas.cn/raspbian/raspbian/
重庆大学 (http|https): //mirrors.cqu.edu.cn/raspbian/raspbian/
上海大学开源社区 (http|ftp|rsync): //mirrors.shu.edu.cn/raspbian/raspbian/
南京大学 (http|https): //mirrors.nju.edu.cn/raspbian/raspbian/
避坑
无