Ubuntu apt and pip change source-Alibaba source
1. Alibaba Cloud official mirror station
Alibaba Cloud official mirror station
Two, apt change source
2. 1. Open the terminal, enter the command, sources.list
make a backup, and then gedit
open it with an editor
cd /etc/apt
sudo cp sources.list sources.list.bak
sudo gedit sources.list
Two, 2. Edit sources.list
files
The sources.list
file contents all removed, and then copy the following
deb http://mirrors.aliyun.com/ubuntu/ xenial main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe
Save after copy
2. Update source, update software
sudo apt update&&sudo apt upgrade -y
Three, pip change source
Three, 1. Introduction
PyPI (Python Package Index) is a software repository for the Python programming language. Developers can find and install software developed and shared by the Python community through PyPI, or upload libraries they develop to PyPI.
Three, 2 configuration method
a. Find the following files
~/.pip/pip.conf
b. Add or modify in the above file:
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com