今天对 sudo apt-get upgrade后,系统就出现了很多问提,开始FindEigen.cmake 找不到,我翻墙找了很多解决办法,试了很多方法。开始是因为版本问题,我才意识到cmake命令也被升级了,我又找到网上将cmake重新安装成cmake2.8.12.2版本(开始是cmake3.3版本),安装完成后,还是没找FindEigen.cmake,后来通过locate FindEigen.cmake才找到在/usr/share/cmake2.8/Module目录下,之后我将该文件拷贝到/usr/bin/cmake2.8下才解决问题。
但是roscore和catkin_make包也出错了(升级之前没问题的),我意识到ros也出错了,然后我卸载了ros想重安装,但这时更大的问题出现了:
The following packages have unmet dependencies:
ros-indigo-desktop-full : Depends: ros-indigo-simulators but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
这时报依赖出错了,我依照缺失依赖并安装缺失依赖,最后提示:
The following packages have unmet dependencies:
gazebo2 : Depends: libsdformat-dev (< 2.0.0) but 3.6.0-1~201512071 is to be installed
E: Unable to correct problems, you have held broken packages.
但不管我卸载原libsdformat-dev在重新安装libsdformat-dev,依然会出现最后这个依赖的错。然后我在ros.org上找的解决办法:https://answers.ros.org/question/243034/ubuntu1404-indigo-desktop-full-install-problem/。 大概就是我通过第三 方repository安装了非官方的ros,这都是之前的sudo apt-get upgrade惹的祸:
It looks like you've installed a different version of ROS from https://launchpad.net/~deb-rob/+archi... , and the packages from that repository are conflicting with the official ROS packages.
The obvious package that's conflicting is libsdformat, but given the size of that repository I suspect there are other conflicts too.
You'll need to remove the conflicting packages that you installed from that repository if you want to install the packages from the official repository; that will probably mean uninstalling the other version of ROS from that repository.
解决办法是将惹祸的repository失效,通过:
apt-cache policy libsdfformat-dev
找到有问题的repository并unable就行了, 这样就可以重装ros-indigo了, 这次关键给我教训upgrade很关键,repository也很有问题。