Ask Your Question

Trouble installing ROS2 alongside ROS1

asked 2020-04-25 01:56:33 -0500

I have ROS Melodic on my Ubuntu 18.04, I installed ROS2 Eloquent and I get the following mistake//warning:

r4t@R4T:~$ source /opt/ros/eloquent/setup.bash 
ROS_DISTRO was set to 'melodic' before. Please make sure that the environment does not mix paths from different distributions.

Then I do eng |grep ROS as mentioned on another thread, and I get


I don't know if the environment is configured correctly since everything it's kind of pointing out to Melodic version

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-04-25 04:46:53 -0500

gvdhoorn gravatar image

It's likely you have source /opt/ros/melodic/setup.bash at the end of your .bashrc (which is added at the end of the Environment Setup section of the ROS 1 installation instructions).

With just a single ROS version installed, that will be convenient (as it prevents you from having to type source /opt/ros/melodic/setup.bash in every new terminal).

However, with multiple ROS versions installed (and this goes for both multiple ROS 1 and ROS 2 versions and a mix of those), it will cause issues such as the one you encountered.

I would recommend to remove the auto-source-ing from your .bashrc, and manually source the setup file of the ROS version you want to work with instead.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2020-04-25 01:56:33 -0500

Seen: 59 times

Last updated: Apr 25