apt更新源

编辑/etc/apt/sources-list

  1. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted
  2. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted
  3. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial universe
  4. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates universe
  5. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial multiverse
  6. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates multiverse
  7. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
  8. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted
  9. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security universe
  10. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security multiverse

pip更新源

在用户目录下创建.pip文件夹,并创建pip.conf文件

  1. [global]
  2. trusted-host = pypi.mirrors.ustc.edu.cn
  3. index-url = https://pypi.mirrors.ustc.edu.cn/simple

或者

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