Ubuntu18.04.1 apt-get install报错: Package ‘xxx‘ has no installation candidate解决方法

对于Ubuntu操作系统,很多同学在使用apt-get install的时候 会发现很多源都找不到,原因是系统初始的资源库找不到指定的包,解决方法:

1、执行下面的命令,编辑系统资源库列表:

             vi /etc/apt/sources.list

2、修改为以下内容(原来的内容可以注释一下):

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

3、执行下面的命令,更新系统资源库列表:

             sudo apt-get update

             sudo apt-get upgrade

4、重新执行sudo apt-get install xxxx 试试

 

在网上找了好多方法都不好使,最后用了阿里云的资源库才搞定,在这里分享给大家,希望大家支持 ~ ^_^

如果对您有帮助,欢迎打赏哦~

谢谢您的查看~