去评论
海欣资源

如何解决Ubuntu E:无法定位软件包

werother
2022/05/13 00:07:46
解决 Ubuntu E:无法定位软件包问题

一定有很多小伙伴遇到了如上问题,之前解决好过,又出问题了,归咎到底还是源镜像的问题
产生 E:无法定位软件包安全提示原因有很多。如网络链接问题、apt 源过期了。

解决方法:
1、备份 /etc/apt/sources.list 文件
执行命令 sudo cp /etc/apt/sources.list /etc/apt/sources.list.old
2、打开文件 sudo vim /etc/apt/sources.list
3、复制阿里源(Ubuntu18.04 配置如下)

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-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed 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


4、重新获取软件包列表
sudo apt-get update

5、在执行安装命令
sudo apt-get install yum