(!) Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

Managing System dependencies

Description: This explains how to use rosdep to install system dependencies.

Tutorial Level: INTERMEDIATE

Next Tutorial: Roslaunch tips for large projects

  Show EOL distros: 

System Dependencies

ROS packages sometimes require external libraries and tools that must be provided by the operating system. These required libraries and tools are commonly referred to as system dependencies. In some cases these system dependencies are not installed by default. ROS provides a simple tool, rosdep, that is used to download and install system dependencies.

ROS packages must declare that they need these system dependencies in the package manifest. Let's look at the manifest for the turtlesim package:

$ roscd turtlesim


$ cat package.xml
  • <package>

As you can see turtlesim needs those libraries and packages.

$ cat manifest.xml
  • <package>
        <rosdep name="libqt4-dev"/>
        <rosdep name="qt4-qmake"/>

As you can see turtlesim needs libqt4-dev and qt4-qmake.


rosdep is a tool you can use to install system dependencies required by ROS packages.


rosdep install [package]

Download and install the system dependencies for turtlesim:

$ rosdep install turtlesim

If you've been following along with the tutorials, it's likely that this is the first time you've used rosdep. When you run this command, you'll get an error message:

  • ERROR: your rosdep installation has not been initialized yet.  Please run:
        sudo rosdep init
        rosdep update

Just run those two commands and then try to install turtlesim's dependencies again.

If you installed using binaries you will see:

  • All required rosdeps installed successfully

Otherwise you will see the output of installing the dependencies of turtlesim:

  • set -o errexit
    set -o verbose
    if [ ! -f /opt/ros/lib/libboost_date_time-gcc42-mt*-1_37.a ] ; then
      mkdir -p ~/ros/ros-deps
      cd ~/ros/ros-deps
      wget --tries=10 http://pr.willowgarage.com/downloads/boost_1_37_0.tar.gz
      tar xzf boost_1_37_0.tar.gz
      cd boost_1_37_0
      ./configure --prefix=/opt/ros
      sudo make install
    if [ ! -f /opt/ros/lib/liblog4cxx.so.10 ] ; then
      mkdir -p ~/ros/ros-deps
      cd ~/ros/ros-deps
      wget --tries=10 http://pr.willowgarage.com/downloads/apache-log4cxx-0.10.0-wg_patched.tar.gz
      tar xzf apache-log4cxx-0.10.0-wg_patched.tar.gz
      cd apache-log4cxx-0.10.0
      ./configure --prefix=/opt/ros
      sudo make install

rosdep runs the bash script above and exits when complete.

Wiki: vn/ROS/Hướng dẫn/rosdep (last edited 2017-03-30 07:36:00 by HoangGiang88)