第一种情况:在确定网络连接和质量没问题的情况下,任何软件都无法安装,出现E:无法定位XXX
解决:换源
具体步骤:
1、备份 /etc/apt/sources.list 文件
执行命令
sudo cp /etc/apt/sources.list /etc/apt/sources.list.old
2、打开文件 sudo vim /etc/apt/sources.list (gedit也可以)
将原文件里面的内容删掉或注释掉
粘贴选择的源:
阿里云源:
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
清华源:
deb 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 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 https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty main universe restricted multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty main universe restricted multiverse
3.sudo apt-get update文章来源:https://www.toymoban.com/news/detail-541919.html
第二种情况:可以安装其他的软件,但唯独无法安装ros-<distro>-xxx(个人版本是melodic)类的软件包,换源也不好使,可以尝试以下方法(前提:key和ros源完备的情况下)(本人此类情况)文章来源地址https://www.toymoban.com/news/detail-541919.html
1.echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/ros-latest.list
2.sudo apt update
然后安装ros-melodic-xxx类的软件包就好使了。
到了这里,关于解决安装软件包时出现E:无法定位的问题的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!