Ubuntu、gazebo、PX4、MoveIt!小白问题记录

目录

1. 软件包XXX没有可安装候选/依赖:XXX但是它将不会被安装

2. 源与Ubuntu版本不匹配的解决方法:

3. python2安装pip2,Ubuntu20.04一般都有python3(没有就sudo apt install python3)

4. 路径问题:Could not find a package configuration file provided by "gazebo" with any of the following names:     gazeboConfig.cmake     gazebo-config.cmake

5. roslaunch px4 mavros_posix_sitl.launch时的小白问题

6. 启动gazebo的时候报错

7. MoveIt!在创建新模型的时候,右边画面没有出现模型视图


1. 软件包XXX没有可安装候选/依赖:XXX但是它将不会被安装

问题描述:

rosnoetic@rosnoetic-VirtualBox:~$ sudo apt install aptitude
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
没有可用的软件包 aptitude,但是它被其它的软件包引用了。
这可能意味着这个缺失的软件包可能已被废弃,
或者只能在其他发布源中找到

E: 软件包 aptitude 没有可安装候选
rosnoetic@rosnoetic-VirtualBox:~$ sudo apt install aptitude
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
有一些软件包无法被安装。如果您用的是 unstable 发行版,这也许是
因为系统无法达到您要求的状态造成的。该版本中可能会有一些您需要的软件
包尚未被创建或是它们已被从新到(Incoming)目录移出。
下列信息可能会对解决问题有所帮助:

下列软件包有未满足的依赖关系:
 aptitude : 依赖: libapt-pkg5.0 (>= 1.1) 但是它将不会被安装
            推荐: libparse-debianchangelog-perl 但是它将不会被安装
E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。

解决方案:源存在问题,进行换源操作。以及需要注意源与Ubuntu版本是否匹配。若是软件包没有可安装选项,考虑源的问题。若是依赖导致不会被安装,考虑源与Ubuntu版本不匹配。

换源方式:引用该文章中第二种方式

ubuntu换镜像源(ubuntu换源)_Fighting_1997的博客-CSDN博客_ubuntu换源

#备份之前的镜像源备份文件

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

#打开镜像源编辑文件

sudo gedit /etc/apt/sources.list

#选择任意一种镜像源文件

#  阿里源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb 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 main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed 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-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
 deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
 deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
#  中科大源
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
#deb cdrom:[Ubuntu 20.04.3 LTS _Focal Fossa_ - Release amd64 (20210819)]/ focal main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ focal main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ focal main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ focal-updates main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ focal-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://cn.archive.ubuntu.com/ubuntu/ focal universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ focal universe
deb http://cn.archive.ubuntu.com/ubuntu/ focal-updates universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ focal-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://cn.archive.ubuntu.com/ubuntu/ focal multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ focal multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ focal-updates multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ focal-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://cn.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu focal partner
# deb-src http://archive.canonical.com/ubuntu focal partner

deb http://security.ubuntu.com/ubuntu focal-security main restricted
# deb-src http://security.ubuntu.com/ubuntu focal-security main restricted
deb http://security.ubuntu.com/ubuntu focal-security universe
# deb-src http://security.ubuntu.com/ubuntu focal-security universe
deb http://security.ubuntu.com/ubuntu focal-security multiverse
# deb-src http://security.ubuntu.com/ubuntu focal-security multiverse

# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.

2. 源与Ubuntu版本不匹配的解决方法:

参考:Ubuntu20.04 错误提醒:无法修正错误_清风微拂;蓝水静流的博客-CSDN博客

#检查自己Ubuntu的版本号

 lsb_release -c 

结果如图所示:

#根据上述操作再次打开镜像源编辑文件,结果如图所示

 上图中均为bionic版本,而非focat版本,因此将bionic全部改成focat,以阿里源为例

# 阿里云镜像源
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

#最后一定要去执行更新!!!否则没有用的

sudo apt-get update
sudo apt-get upgrade

3. python2安装pip2,Ubuntu20.04一般都有python3(没有就sudo apt install python3)

参考:Ubuntu20.04安装python2和python3及版本配置_PanGC2014的博客-CSDN博客_ubuntu python2安装

#安装python2

sudo apt install python2

#设置python的优先级(选择1切换到python2)

sudo update-alternatives --config python

 #安装curl下载工具

sudo apt-get install curl

#下载脚本

sudo curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py

#运行安装脚本

sudo python get-pip.py

#检查一下pip版本

pip --version

显示python 2.7则安装成功。 

4. 路径问题:Could not find a package configuration file provided by "gazebo" with any of the following names:     gazeboConfig.cmake     gazebo-config.cmake

 解决方案:

sudo apt-get install libgazebo9-dev    #我用的gazebo9,自己改版本即可

5. roslaunch px4 mavros_posix_sitl.launch时的小白问题

问题描述:

 问题原因:

之前开了PX4的终端没有关闭!!!!!!!!!关了那个终端重新开就好。

6. 启动gazebo的时候报错

问题描述:

gazebo: symbol lookup error: /usr/lib/x86_64-linux-gnu/libgazebo_common.so.9: undefined symbol: _ZN8ignition10fuel_tools12ClientConfig12SetUserAgentERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
解决方案:重进就好

7. MoveIt!在创建新模型的时候,右边画面没有出现模型视图

问题描述:

[rospack] Error: package 'XXX' not found

[librospack]: error while executing command

[ERROR] [1676467525.014925400]: Error retrieving file [package://probot_description/meshes/base_link.STL]: Package 

解决办法:

每一篇博文都告诉我要重新source一下工作空间,即在工作空间内:

source devel/setup.bash

或者是打开看看ros工作包里面有没有工作空间的路径:

echo $ROS_PACKAGE_PATH 

若是没有,则打开主目录下的.bashrc,加入工作空间的路径:

source ~/XXX(工作空间名,如xxx_works)/devel/setup.bash

保存后,一定要用catkin build或者catkin_build去编译一下工作空间!!!

一直以为不行,还是自己的操作有问题,更改了.bashrc文件一定要重新编译~

写在最后:建议还是双系统直接ubuntu18.04,重装不过一天时间能解决90%的问题,而且网上各种问题的解决方案特别多,总有合适的!

  • 3
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值