Rosanswers logo


I'm trying to set my ROS_PACKAGE_PATH variable permanently. I appended the following line to the etc/environment file: ROS_PACKAGE_PATH="/home/zayin/catkin_ws/src:/opt/ros/groovy/share:/opt/ros/groovy/stacks". Then, I logged out and back in. However, when I type echo $ROS_PACKAGE_PATH in the terminal, I get /opt/ros/groovy/share:/opt/ros/groovy/stacks, which is the initial setting. What have I forgotten to do? Thanks!

Originally posted by Zayin on ROS Answers with karma: 343 on 2013-05-10

Post score: 0


1 Answer 1


Rosanswers logo

Similar questions/answers exist - see here, here.

Unless you add your workspace to the package path in your ~/.bashrc file, each time you open a new terminal you will need to source your workspace (see this tutorial).

To set your workspace permanently, open your .bashrc file in a text editor, for example -- gedit ~/.bashrc -- and add

export ROS_PACKAGE_PATH=/your/path/to/workspace:$ROS_PACKAGE_PATH

at the bottom of your file. Obviously, make sure you change "/your/path/to/workspace" to your exact workspace path..

Originally posted by Souldier with karma: 198 on 2013-05-10

This answer was ACCEPTED on the original site

Post score: 8

Original comments

Comment by Zayin on 2013-05-10:
Thanks! I got it to work thanks to these topics!

Comment by RosUser on 2016-01-25:
I don't understand the last part :$ROS_PACKAGE_PATH Should it be like this ROS_PACKAGE_PATH=/home/hjt/catkin_ws/src:$ROS_PACKAGE_PATH

Comment by bemery94 on 2017-02-05:
The ":$ROS_PACKAGE_PATH" means that you are adding "/home/hjt/catkin_ws/src" to the start of the ROS_PACKAGE_PATH, whereas if you just did "export ROS_PACKAGE_PATH=..." then the new ROS_PACKAGE_PATH would overwrite the existing path.


Your Answer

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