ROS安裝時packages have unmet dependencies問題

在ROS安裝的過程中,當運行sudo apt-get install ros-***後,我們常常會遇到類似下面的錯誤:

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:
 ros-***-desktop-full : Depends: ros-***-mobile but it is not going to be installed
                          Depends: ros-***-perception but it is not going to be installed
                          Depends: ros-***-simulators but it is not going to be installed
E: Unable to correct problems, you have held broken packages.


解決方法主要有以下兩種:

1. 每次安裝第一個缺失的依賴包

    如: sudo apt-get install ros-***-mobile ,運行該命令後可能會出現新的依賴包缺失問題,再次安裝新的第一個缺失的依賴包。

    如此這般,直到安裝好所有的依賴包,再次執行命令

    sudo apt-get install ros-***;

2. 在第一種方法解決不了的情況下使用:

    sudo aptitude install ros-*** 代替  sudo apt-get install ros-***;

    對於前面的提示Accept this solution? [Y/n/q/?],選擇n

    直到出現類似這樣的提示時,選擇Y:

    The following actions will resolve these dependencies:
     Install the following packages:           
     1)     ps-engine [5.0.3.3-3+precise1 (precise)]
     Accept this solution? [Y/n/q/?]

   

經過以上操作,問題基本可以解決。如果還是無法安裝ROS,則需要具體問題具體分析。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章