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

apt-get vs git clone

asked 2021-05-15 10:05:26 -0500

Celebrimbor gravatar image

updated 2021-05-17 07:23:09 -0500

miura gravatar image

Hello everyone

Im new to ROS platform and im about to build my first real world robot using ROS. M question might sound bad or something but i have to ask since im only a beginner.

which is the best practice for installing ROS packages, apt-get or git clone. For example if i want to install the gmapping package for my robot, should i:

  • Install the gmapping package using sudo apt-get command and as far as i know if i use this command, the gmapping package will be available for all workspaces and packages.

  • Install the gmapping package using git clone command.

edit retag flag offensive close merge delete



@miura: why did you add the ros2 tag?

gvdhoorn gravatar image gvdhoorn  ( 2021-05-17 07:59:41 -0500 )edit

@gvdhoorn , from your answer and comment, I decided that the question applies to ROS2 as well.

miura gravatar image miura  ( 2021-05-17 08:49:00 -0500 )edit

Thank you very much, sir, the answer was veryy helpful

Celebrimbor gravatar image Celebrimbor  ( 2021-05-19 09:21:32 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2021-05-16 07:17:06 -0500

gvdhoorn gravatar image

updated 2021-05-16 10:55:25 -0500

It's just my opinion of course -- and there will certainly be others with different opinions -- but see #q320046 for an earlier Q&A on this topic.

Technically that Q&A is about how to install packages, but I took the time there to add some more context and guidelines as to when to choose which method of installation.

Summarising: always prefer apt (or dnf now with RPM distributions supported), unless there is no release of a package for a specific OS, platform, CPU architecture or with a specific patch included. And for that last case building from source is really only necessary / acceptable until the main release (ie: the one installable using apt) gets the patch.

And a final comment:

Install the gmapping package using git clone command.

git clone-ing a repository is not the same as installing a package.

It's only one step in a (potentially involved and time consuming) process.

But see #q320046.

edit flag offensive delete link more



And although you mark this as ros1, I don't believe I'd change my answer in the context of ROS 2 (except of course the ROS 1 wiki is not used for ROS 2 packages).

gvdhoorn gravatar image gvdhoorn  ( 2021-05-16 07:18:17 -0500 )edit

Question Tools

1 follower


Asked: 2021-05-15 10:05:26 -0500

Seen: 550 times

Last updated: May 16 '21