Ubuntu安装pip提示Unable to locate package python3-pip3

岁酱吖の 提交于 2020-01-22 01:38:51

问题: ubuntu16.04 下 , sudo apt-get install 失败

在这里插入图片描述

一般情况下

1、sudo apt-get update

2、sudo apt-get install python3-pip

就可以了,但是有时候人生可能不够凄惨
结果出错了。

如果sudo apt-get update 出错了

  1. 被墙了:换成国内源即可。
  2. 或者因为architecture不兼容:删掉不兼容的architecture

对于情况1,可以更换成清华的镜像源解决:

cd /etc/apt
sudo cp sources.list sources.list.bak
sudo gedit sources.list

换成清华镜像源,sources.list 如下:

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse

更新源

sudo apt-get update

对于情况2:移除不兼容的architecture

sudo dpkg --print-architecture
 
sudo dpkg --print-foreign-architectures

如果是开发板,就需要移除amd64;

如果是PC机,就需要移除arm64;

jetson Tx2为例,如果打印出现 amd64,那就移除它

sudo apt-get remove .*:amd64
 
sudo dpkg --remove-architecture amd64
 
sudo apt-get update

千万不要删错了,不然可以考虑重装系统了

最后update时出现一些抓取不到的404问题,没有关系,可以正常apt-get install

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!