各种镜像源的更换
树莓派
本次采用的是一块树莓派3B-PLUS的板子
树莓派的版本信息确定
查看树莓派的版本信息的几种方式:
-
uname -a
Linux raspberrypi 4.19.57-v7+ #1244 SMP Thu Jul 4 18:45:25 BST 2019 armv7l GNU/Linux
-
lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 10 (buster)
Release: 10
Codename: buster
-
使用软件查看:
.‘,;:cc;,‘. .,;::c:,. [email?protected],ooolcloooo: ‘oooooccloo: OS: Raspbian 10 buster
.looooc;;:ol :oc;;:ooooo‘ Kernel: armv7l Linux 4.19.57-v7+
;oooooo:,ooooooc. Uptime: 11m
.,:;‘. .;:;‘. Packages: 1446
.... ..‘‘‘‘‘. .... Shell: 858
.‘‘. ..‘‘‘‘‘. ..‘‘. DE: LXDE
.. ..... ..... .. WM: OpenBox
. .‘‘‘‘‘‘‘ .‘‘‘‘‘‘. . CPU: ARMv7 rev 4 (v7l) @ 1.4GHz
.‘‘ .‘‘‘‘‘‘‘‘ .‘‘‘‘‘‘‘. ‘‘. RAM: 183MiB / 874MiB
‘‘‘ ‘‘‘‘‘‘‘ .‘‘‘‘‘‘ ‘‘‘
.‘ ........... ... .‘.
.... ‘‘‘‘‘‘‘‘. .‘‘.
‘‘‘‘‘. ‘‘‘‘‘‘‘‘. .‘‘‘‘‘
‘‘‘‘‘. .‘‘‘‘‘. .‘‘‘‘‘.
..‘‘. . .‘‘..
.‘‘‘‘‘‘‘
......
总结:
从上述三种方式中,可以看出其操作系统为Raspbian 10 buster
,有了这条信息,即可进行后续的换源操作。
换源
可参考清华站的使用帮助即可:https://mirrors.tuna.tsinghua.edu.cn/help/raspbian/
-
进入上述网站;
-
在使用说明
栏中选择之前查询的树莓派操作系统的版本,例如我的为Debian 10
;
-
编辑 /etc/apt/sources.list
文件,将其中的内容修改为:
deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib
deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib
将原先的内容用#+space
注释掉即可
-
再编辑/etc/apt/sources.list.d/raspi.list
文件,将其中内容修改为:
deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui
-
编辑镜像站后,使用sudo apt-get update
命令,更新软件源列表,同时检查方才的编辑是否正确。
Anaconda换源
参照清华站使用帮助:https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/
PIP/PIP3的换源
参照清华站使用帮助:https://mirrors.tuna.tsinghua.edu.cn/help/pypi/
-
临时使用,推荐
-
永久:
pip install pip -U
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U
参考:
https://jingyan.baidu.com/album/ca00d56c144644e99febcf4d.html?picindex=3
https://mirrors.tuna.tsinghua.edu.cn/help/AOSP/
https://mirrors.tuna.tsinghua.edu.cn/help/raspbian/
https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/
https://mirrors.tuna.tsinghua.edu.cn/help/pypi/