Ubuntu change source-Ali source

1. Alibaba Cloud official mirror station

Alibaba Cloud official mirror station

Ubuntu mirror
pypi mirror

Two, apt change source

2. 1. Open the terminal, enter the command, sources.listmake a backup, and then geditopen it with an editor

cd /etc/apt
sudo cp sources.list sources.list.bak
sudo gedit sources.list

Edit the sources.list file

Two, 2. Edit sources.listfiles

Insert picture description hereThe sources.listfile contents all removed, and then copy the following
Insert picture description here

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
Insert picture description here

2. Update source, update software

sudo apt update&&sudo apt upgrade -y

Insert picture description here

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

Guess you like

Origin blog.csdn.net/yong15565566939/article/details/112061848