0
点赞
收藏
分享

微信扫一扫

【Bug解决】Ubuntu安装pip3:无法定位软件包问题


问题情景

在虚拟机上,我安装了Ubuntu18.04版本,系统默认自带了python3.6.5,然而没安装pip工具。
使用下面的语句进行安装

sudo apt install python3-pip

结果报错:​​无法定位软件包问题​

问题原因和解决

这是因为之前我对apt进行了换源,更换了清华源,然而,目前这个源似乎在Ubuntu18.04无法使用,于是换成阿里源
使用​​​gedit​​打开源文件

sudo gedit /etc/apt/sources.list

将文件里面的内容全部替换

deb http://mirrors.aliyun.com/ubuntu bionic main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu bionic-updates main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu bionic-security main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu bionic-proposed main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu bionic-backports main multiverse restricted universe

然后更新软件包

sudo apt-get update

现在再次输入安装命令,即可成功安装。


举报

相关推荐

0 条评论