Ubuntu20.04 apt pip 配置阿里源

配置apt源

  1. 备份原来的源
cp /etc/apt/sources.list /etc/apt/sources.list.bak
  1. 将代码复制到/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

  1. 系统更新
sudo apt-get update

配置pip源

  1. 更新pip
pip install pip -U
  1. 更改pip下载源
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/

你可能感兴趣的:(Ubuntu20.04,ubuntu,apt,pip)