ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

The impact of installing packages via apt-get or source on portability

asked 2016-08-12 11:49:50 -0600

I am wondering if the choice one makes between installing packages via apt-get or from source has any impact on how easy it then becomes to install on another computer. It seems to me that since apt-get installs packages in the opt folder, that you would have to install all of those packages on the new computer before running your code. That would be a major hassle if you have dozens of packages. But from what I've read it seems like people prefer apt-get to building from source because its easier. Is this just because people generally aren't transferring their code, or am I missing something? Please be specific with answers.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-08-12 12:54:55 -0600

ahendrix gravatar image

Installing packages through apt ensures that you have a pre-compiled, working version of the package. It's generally a faster, more consistent way to install packages, and it uses less disk space. The downside to installing packages from apt is the extra effort required to create apt packages and the delay of waiting for those packages to propagate through the build farm.

Installing packages from source ensures that you have a very specific version of a package; either the very latest version or a specific version that you need for compatibility reasons. The downside is the additional compilation time.

The general best practice is to install any software you're actively developing from source, and to install your dependencies from apt. If your source packages declare their dependencies well, installing those dependencies from is a single rosdep command. If you are using source code from many repositories, you can define your workspace with a rosinstall file.

The general setup procedure for a new robot or a new system is then:

  • Install a base version of ROS from apt (robot, desktop or desktop-full depending on your preference)
  • Check out your source code or download your rosinstall file and use wstool to check out your source code
  • Use rosdep install --from-paths src -i from your workspace to install all of your dependencies from apt
  • Build your workspace
edit flag offensive delete link more


The downside is the additional compilation time

You mention it later on ("if [..] source packages declare their dependencies well"), but perhaps the biggest problem with compiling from source for many users is exactly the dependency hell management. Especially on non-Ubuntu systems.

gvdhoorn gravatar image gvdhoorn  ( 2016-08-12 13:35:10 -0600 )edit

If you're deploying to many robots, there's no substitute for having a good process for doing that deployment. You can do that by using the existing tooling (and contributing rosdep rules where they're missing) or you can build custom tools.

ahendrix gravatar image ahendrix  ( 2016-08-12 14:06:51 -0600 )edit

I'm not disagreeing with the approach you described in your answer. I'm merely pointing out that it's most of the times the dependency management / resolving that many (new) users find difficult. It's one of the benefits of installing binary packages (ie: debs) that not many ppl appreciate enough.

gvdhoorn gravatar image gvdhoorn  ( 2016-08-12 14:36:43 -0600 )edit

Question Tools

1 follower


Asked: 2016-08-12 11:49:50 -0600

Seen: 177 times

Last updated: Aug 12 '16