Linux装机问题

1、ubuntu更换镜像源

第一步:进入到镜像源存放位置——cd /etc/apt/

第二步:备份镜像文件——cp source.list source.list1

第三步:打开镜像文件,替换里边的内容(阿里云镜像源)——sudo source.list

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

第四步:更新源并升级

sudo apt-get update
sudo apt-get upgrade

2、解决Ubuntu中pip版本过低问题 

问题:

You are using pip version 8.1.1, however version 20.0.2 is available. You should consider upgrading via the 'pip install --upgrade pip' command.

解决方法一:

按照“pip install --upgrade pip”升级pip3不可以,pip3的升级不是用这条命令,应该使用“pip3 install --upgrade pip”命令才能将pip3升级

解决方法二:

第一步:sudo apt-get update

第二步:sudo apt-get upgrade

第三步:wget https://bootstrap.pypa.io/get-pip.py

第四步:sudo python get-pip.py

引用:https://blog.csdn.net/shuipengpeng/article/details/89223248

3、解决pip安装包超时问题

错误代码:

pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

pip --default-timeout=100 install 库名称 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

 

你可能感兴趣的:(Linux)