本文共 1490 字,大约阅读时间需要 4 分钟。
1. apt 获取资源过慢问题
更换apt下载源, apt下载源在 /etc/apt/sources.list中, 先把原来的数据copy一个副本
cd /etc/aptsudo cp source.list source.list.bak
然后查看系统的codename, 比如我的是 bionic
yeyeck@ubuntu:~$ lsb_release -aNo LSB modules are available.Distributor ID: UbuntuDescription: Ubuntu 18.04.1 LTSRelease: 18.04Codename: bionicyeyeck@ubuntu:~$
再把/etc/apt/sources.list里的数据全部删掉, 把以下数据中标记的bionic 全部替换为你系统的codename, 并保存
deb http://mirrors.aliyun.com/ubuntu/ bionic main multiverse restricted universedeb http://mirrors.aliyun.com/ubuntu/ bionic-backports main multiverse restricted universedeb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main multiverse restricted universedeb http://mirrors.aliyun.com/ubuntu/ bionic-security main multiverse restricted universedeb http://mirrors.aliyun.com/ubuntu/ bionic-updates main multiverse restricted universedeb-src http://mirrors.aliyun.com/ubuntu/ bionic main multiverse restricted universedeb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main multiverse restricted universedeb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main multiverse restricted universedeb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main multiverse restricted universedeb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main multiverse restricted universe
最后执行以下命令
sudo apt-get update
2. pip3 下载慢的问题
mkdir ~/.pipsudo vim ~/.pip/pip.conf
然后在文件中输入以下内容,保存即可
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/[install]trusted-host = mirrors.aliyun.com
转载地址:http://uocjo.baihongyu.com/