ubuntu日常更换各种源

更换apt源

sudo cp /etc/apt/sources.list /etc/apt/sources_init.list
sudo vim /etc/apt/sources.list

填入以下内容

deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

然后更新软件

sudo apt-get update
sudo apt-get -f install
sudo apt-get upgrade

更换pip源

mkdir ~/.pip

vim ~/.pip/pip.conf

写入以下内容

[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host= mirrors.aliyun.com

更换Docker源

暂无评论

发表评论