Rosanswers logo

Hello. I have problem with roscore. When I try to run roscore I give this error:

Traceback (most recent call last): File "/opt/ros/groovy/lib/python2.7/dist-packages/roslaunch/init.py", line 230, in main write_pid_file(options.pid_fn, options.core, options.port) File "/opt/ros/groovy/lib/python2.7/dist-packages/roslaunch/init.py", line 106, in write_pid_file with open(pid_fn, "w") as f: IOError: [Errno 13] Permission denied: '/home/user/.ros/roscore-11311.pid'

Does someone know how I can fix it ?

Originally posted by Roboticus on ROS Answers with karma: 1 on 2013-04-09

Post score: 0

Original comments

Comment by prasanna.kumar on 2013-04-09:
If you have source /root/catkin_ws/devel/setup.bash in your .bashrc remove it, create the catkin workspace again and check.

Comment by Roboticus on 2013-04-09:
It still doesn't work. I deleted my existing workspace, source from .bashrc and create new ones still appears this error. Maybe someone else know how fix this problem. I reinstall whole ROS and still nothing. I'm begginer in ROS.

Comment by dornhege on 2013-04-10:
Something is setup wrong. You can't write to the .ros directory or that specific file. What do you get for id -a, ls -la .ros?


2 Answers 2


Rosanswers logo

Hey guys, the problem could be that you ran rosdep update with sudo rights. That leads to permission errors later on.

NOTE : Run rosdep update NOT with sudo.

SOLUTION to fix this run sudo rosdep fix-permissions

and after that rosdep update.

Worked for me.



Originally posted by Timo with karma: 86 on 2015-02-12

This answer was ACCEPTED on the original site

Post score: 7

Original comments

Comment by imAsim on 2015-03-17:
Perfect it does the trick for me. I was running programs from 'ROS by Example for Hydro - Volume 1'. I was not able to execute $ roslaunch rbx1_bringup fake_turtlebot.launch or $ roslaunch rbx1_bringup fake_pi_robot.launch

I would get 'IOERROR [Error13] ...'. Anyhow it is fixed now. Thanks!

Comment by luc on 2015-09-08:
the rosdep fix-permissions command worked for me!

Comment by kjerath on 2015-11-10:
Worked like a charm...

Comment by Vijay on 2016-02-16:
Awesome ,it worked.. than q @imAsim


Rosanswers logo

I had a similar problem running roscore. The problem was that the hidden folder " ~/.ros" required root rights.

To solve it, I deleted the folder with:

sudo su
rm -R ~/.ros/

After that, roscore worked well and a new .ros folder was created automatically.

Originally posted by MachR with karma: 1 on 2013-04-10

This answer was NOT ACCEPTED on the original site

Post score: 2

Original comments

Comment by dornhege on 2013-04-10:
If .ros required root rights, something was wrong before. Maybe some sudo call. ROS doesn't set the up as root.

Comment by MachR on 2013-04-10:
Yes, there was a mistake in the groovy installation documentation, saying to run the command with sudo. This leads to the error. The documentation is corrected now.

Comment by zurish on 2015-02-11:
It doesn't work. When I entered the two command lines "rm: cannot remove ‘/root/.ros/’: No such file or directory" showed up. What is the problem?

Comment by dornhege on 2015-02-12:
You are in the home of the root user, not in the home of the user, where you want to remove the .ros directory.

Comment by zurish on 2015-02-12:
@dornhege Thanks it's working now.

Comment by Joy16 on 2017-04-10:
Worked like charm. But could you please explain what .ros contains? I thought it only stored the logs.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.