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

Revision history [back]

click to hide/show revision 1
initial version

You most likely have multiple source /.../setup.bash lines the .bashrc file in your $HOME directory.

Additionally: we see mentions of melodic, jade, noetic and kinetic.

Those ROS versions cannot be installed on the same version of Ubuntu (or Windows for that matter), so something must have gone wrong. Have you tried to follow multiple installation tutorials, for different versions of ROS?

To rectify this situation:

  • open the .bashrc file, for instance using nano: nano -w $HOME/.bashrc (I'm assuming you don't have a GUI for your Linux install, as you mention you're using Ubuntu in WSL on Windows 10, if you do have a GUI, you could use gedit $HOME/.bashrc)
  • now scroll all the way down to the end of the file (using the arrow keys)

you should see something like this:

source /home/waypoint/turtlebot3_ws/install/setup.bash
source /opt/ros/melodic/setup.bash
source /opt/ros/melodic/setup.bash
source source/opt/ros/jade/setup.bash
source /opt/ros/kinetic/setup.bash
source /opt/ros/kinetic/setup.bash
source /opt/ros/noetic/setup.bash

For now, just remove all of those lines (using the backspace or delete keys). Then save the file using ctrl+o, enter, ctrl+x.

If you did it correctly, the errors should be gone.

At this point you probably want to verify you've actually installed ROS, as the errors you show seem to indicate your install wasn't successful, and some important files are missing.

What's the output of ls -al /opt/ros/{melodic,noetic}?

You most likely have multiple source /.../setup.bash lines in the .bashrc file in your $HOME directory.

Additionally: we see mentions of melodic, jade, noetic and kinetic.

Those ROS versions cannot be installed on the same version of Ubuntu (or Windows for that matter), so something must have gone wrong. Have you tried to follow multiple installation tutorials, for different versions of ROS?

To rectify this situation:

  • open the .bashrc file, for instance using nano: nano -w $HOME/.bashrc (I'm assuming you don't have a GUI for your Linux install, as you mention you're using Ubuntu in WSL on Windows 10, if you do have a GUI, you could use gedit $HOME/.bashrc)
  • now scroll all the way down to the end of the file (using the arrow keys)

you should see something like this:

source /home/waypoint/turtlebot3_ws/install/setup.bash
source /opt/ros/melodic/setup.bash
source /opt/ros/melodic/setup.bash
source source/opt/ros/jade/setup.bash
source /opt/ros/kinetic/setup.bash
source /opt/ros/kinetic/setup.bash
source /opt/ros/noetic/setup.bash

For now, just remove all of those lines (using the backspace or delete keys). Then save the file using ctrl+o, enter, ctrl+x.

If you did it correctly, the errors should be gone.

At this point you probably want to verify you've actually installed ROS, as the errors you show seem to indicate your install wasn't successful, and some important files are missing.

What's the output of ls -al /opt/ros/{melodic,noetic}?