Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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.