Ask Your Question

Trying to do sudo rosdep init and getting the below error

asked 2020-02-10 10:59:25 -0600

srujan gravatar image

updated 2020-02-10 18:46:48 -0600

jayess gravatar image

Following the tutorial to install ROS Melodic I'm using Ubuntu 18.04 on x86_64. I had Ubuntu 16.04 with ROS Kinetic previously. I removed ROS Kinetic from Ubuntu 16.04. Upgraded from Ubuntu 16.04 to Ubuntu 18.04 and then trying to install ROS melodic.


sudo: unable to execute /usr/local/bin/rosdep: No such file or directory
edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2020-02-12 21:54:02 -0600

srujan gravatar image

updated 2020-02-12 21:57:04 -0600

The fix was very simple, I went to the /usr/local/bin and removed everything related to ROS and Catkin. That resolved my issue. The next time when I installed ros-melodic and did rosdep init, I saw the rosdep files in usr/bin/ and everything worked smooth from there.

edit flag offensive delete link more

answered 2020-02-10 13:59:36 -0600

tfoote gravatar image

The version of rosdep that comes from the debian packages should be in /usr/bin not /usr/local/bin

I'd hazard a guess that you had a from source or from pip installation on your system at some point previously. During your upgrade you removed it, but there's still a reference to it on your path.

You might have an alias or other thing in your users' or root's .bashrc or other environment setup that needs to be cleaned up. Or you might have a redirection script somewhere that's out of date.

edit flag offensive delete link more


I have definitely used pip installation previously. I also had anaconda3 which was redirecting the python to a different location, hence I removed anaconda3 completely. Now, I removed the melodic and its dependencies and reinstalled melodic again. Still I get the same error. Can you show me a direction where those redirection scripts could be?

Thank you

srujan gravatar image srujan  ( 2020-02-10 17:43:10 -0600 )edit

Unfortunately I don't know what you've done on your system to cause it to look in that location. My best guesses are above to look for aliases in your bash settings. Reinstalling melodic isn't going to make a difference if your environment is pointing to the wrong place. It sounds like you've used a bunch of tools that change your environment like anaconda so you'll need to figure out which ones failed to wind back successfully.

tfoote gravatar image tfoote  ( 2020-02-10 17:52:18 -0600 )edit

Thanks for your suggestion. I made sure rosdep is in the /usr/bin

srujan gravatar image srujan  ( 2020-02-12 21:55:17 -0600 )edit

answered 2020-02-11 02:32:01 -0600

SSar gravatar image

My best guess is that you could try sudo apt-get purge python-rosdep which removes rosdep completely. Then you could try reinstalling with sudo apt install python-rosdep(source here).

edit flag offensive delete link more


Thanks for your suggestion. I tried doing that but it didn't help me.

srujan gravatar image srujan  ( 2020-02-12 21:54:17 -0600 )edit

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-02-10 10:59:25 -0600

Seen: 792 times

Last updated: Feb 12 '20