解决Ubuntu命令“sudo apt-get install”——“ E: 无法定位软件包”问题

1. 添加镜像源 (本文是清华源)。运行代码:

sudo vim /etc/apt/sources.list

添加如下内容:

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

2.更新源

sudo apt-get update

3.接下来便可以安装未成功安装的软件包了,并且速度会比之前更快

上一篇:2.3基本算法之递归变递推 1188 菲波那契数列(2)


下一篇:Python国内镜像地址