安装ROS遇到的报错以及解决方法

报错1 Package ‘python-rosinstall’ has no installation candidate

E: Package 'python-rosinstall' has no installation candidate
E: Package 'python-rosinstall-generator' has no installation candidate
E: Package 'python-wstool' has no installation candidate
yyq@ubuntu:~$ sudo apt-get install python-wstool
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package python-wstool is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  python3-wstool

E: Package 'python-wstool' has no installation candidate

错误原因是现在支持的是python3版本,给每个指令带上python3即可
解决办法

yyq@ubuntu:~$ sudo apt-get install python3-rosinstall -y //安装成功
yyq@ubuntu:~$ sudo apt-get install python3-rosinstall-generator -y //安装成功
yyq@ubuntu:~$ sudo apt-get install python3-wstool -y //安装成功

报错2 bash: /opt/ros/melodic/setup.bash: No such file or directory

yyq@ubuntu:~$ source ~/.bashrc
bash: /opt/ros/melodic/setup.bash: No such file or directory
bash: /opt/ros/neotic/setup.bash: No such file or directory

解决方法
输入gedit .bashrc 注意这里确定自己当前所在的路径下是否有.bashrc文件,有的话才能用这条命令,否则在.bashrc前面加上绝对路径

报错3

apt-get /var/lib/dpkg/lock-frontend

解决方法
重启ubuntu

报错4 Unable to correct problems, you have held broken packages.

yyq@ubuntu:~$ sudo apt install catkin
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 catkin : Depends: python3-catkin-pkg (>= 0.4.14-2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

出错原因是在安装catkin的时候,要制定ros的版本名称

解决方法

yyq@ubuntu:~$ sudo apt install ros-noetic-catkin
Reading package lists... Done
Building dependency tree       
Reading state information... Done
ros-noetic-catkin is already the newest version (0.8.10-1focal.20210423.221558).
ros-noetic-catkin set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 14 not upgraded.

报错5 rosbash : Depends: catkin but it is not going to be installed

rosbash : Depends: catkin but it is not going to be installed

解决方法
sudo apt install ros-noetic-rosbash//这里我的版本是noetic,不同版本输入自己的版本名

猜你喜欢

转载自blog.csdn.net/m0_61780496/article/details/129912943
今日推荐