Q: Why should I switch to the domestic apt-get
download source and pip
download source?
A: Prevent the download speed from being too slow.
Type the command in the terminal:
sudo nano /etc/apt/sources.list
#
Comment out with a sign at the beginning of the first line , and copy the following content to the last line ( note the version of the Raspberry Pi system installed: Debian 10 Buster, Stretch, Jessie ).
The effect in the figure:
deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi
deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi
note:
First press on the keyboard ctrl+x
, then press Enter to save, then press y
and to enter
exit the nano editor to return to the command line interface. Then enter the following command to update to the latest software list of the mirror source of Tsinghua University.
sudo apt-get update
Change source to pip:
sudo mkdir ~/.pip
ls .pip
sudo nano pip.conf
Enter the following in the opened file:
[global]
timeout = 10
index-url = http://mirrors.aliyun.com/pypi/simple/
extra-index-url= http://pypi.douban.com/simple/
[install]
trusted-host=
mirrors.aliyun.com
pypi.douban.com
Press on the keyboard first ctrl+x
, then press y
and enter
save to exit the editor and return to the command line interface.
Reference