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

How to source the file permanently

asked 2016-04-19 02:51:02 -0500

Zero gravatar image

every time I open the terminal try to run the package launch file but it always have to source the file first before to launch the file.

does there any way can source the file permanently?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-04-19 03:21:29 -0500

gvdhoorn gravatar image

updated 2016-04-19 03:21:57 -0500

This is explained in the Installation tutorial, section 1.6 - Environment setup (here from the Jade tutorial):

It's convenient if the ROS environment variables are automatically added to your bash session every time a new shell is launched:

echo "source /opt/ros/jade/setup.bash" >> ~/.bashrc
source ~/.bashrc

Note also the warning:

If you have more than one ROS distribution installed, ~/.bashrc must only source the setup.bash for the version you are currently using.

If you just want to change the environment of your current shell, you can type:

source /opt/ros/jade/setup.bash

Btw: sourceing is never 'permanent'. It will always only update the shell in which it was invoked.

edit flag offensive delete link more


Thank you! it work for me.

Zero gravatar image Zero  ( 2016-04-19 22:24:13 -0500 )edit

It does not work, there must be some error in the syntax.

ranjeet gravatar image ranjeet  ( 2021-01-31 02:30:46 -0500 )edit

If you're using a different ROS release, you'll have to update the command and replace jade with whatever ROS release you're using.

gvdhoorn gravatar image gvdhoorn  ( 2021-01-31 05:36:55 -0500 )edit

Question Tools

1 follower


Asked: 2016-04-19 02:51:02 -0500

Seen: 2,880 times

Last updated: Jan 31 '21