If you always want
/opt/ros/kinetic/setup.bash sourced when you open a new interactive bash shell, put the
source command at the end of the
.bashrc file in your home directory.
You may want to back it up (though if you haven't modified it then it's the same as
/etc/skel/.bashrc). You can do by running:
cp ~/.bashrc ~/.bashrc.orig
~/.bashrc in a text editor. To use the in-terminal editor
To use the GUI editor Gedit, replace
Add this line at the end of the file:
Save the file and quit the text editor.
Subsequently started interactive shells will bet set up for ROS.
You don't have to manually source
setup.bash anymore. The change persists across logins and reboots, because
~/.bashrc is itself automatically sourced, but not automatically modified, in interactive bash shells. But it applies only to your user account and only in bash.
If you want to undo it, just open
~/.bashrc in a text editor and remove the line you added or comment it out by writing a
# at the beginning of it. (Or restore the backup of the file.)