My ROS-system was working pretty well.

Then, I installed rosdep by using sudo apt install python-rosdep2, which ended fine without showing any issues. Then I issued

sudo rosdep init
sudo rosdep update

which also ended without showing issues.

But now, my ROS-installation seems to be broken because I can't source my ROS any more!

For example, typing ROS-commands, such as

roscore or rqt

results in:

enter image description here

Sourcing, as usual with source /opt/ros/meldoic/setub.bash makes no difference.

What has happened? How to fix this?

Additional Info:

Typing ros<tab><tab> only shows me the following options anymore:

enter image description here

Where is all the rest gone?


Install ROS properly again using (Just execute this command, don't worry nothing will be installed twice) sudo apt-get update
sudo apt-get install ros-melodic-desktop-full

also source your ROS packages using (there seems to be a typo in what you've typed above)
source /opt/ros/melodic/setup.bash
You can add this line to your .bashrc file so your ROS automatically get sourced everytime you open any terminal.


rosdep update should be run without sudo. ROS wiki/rosdep.

sudo rosdep init
rosdep update ## without sudo

Running rosdep update again might solve your problem, although I haven't encountered this specific problem myself. Further steps to investigate could be to search for the commands you are missing (rqt, rostopic). For example search for roscore:

find /opt/ros/$ROS_DISTRO/bin -iname roscore

$ROS_DISTRO might need to be manually to your ROS distribution (for example noetic).

Edit: The following rosdep command will attempt to fix the permission issue.

rosdep fix-permissions

According to the rosdep man page:

rosdep fix-permissions: "Recursively change the permissions of the user's ros home directory. May require sudo. Can be useful to fix permissions after calling "rosdep update" with sudo accidentally."


If you're using the ROS distribution melodic, it's likely that installing python-rosdep2 removed much of it from your system if you didn't pay attention to the apt prompts.

If you're using the packages.ros.org sources following the official installation you should be using python-rosdep not python-rosdep2 which comes from the Upstream repositories.

The same issue was found here for python3-rosdep2 and noetic but it's the same conflict.

Your solution will be to switch back to python-rosdep and reinstall your melodic packages.

Note that the answer by @pvl is sill important that you shouldn't use sudo rosdep update.

And I would recommend looking a little closer at what happens when you run apt and say yes/no to the prompts. ended fine without showing any issues likely also told you it was uninstalling most of melodic at the same time. (It was successful and exited cleanly, is not necessarily the same as doing what you wanted.)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.