0
$\begingroup$

Rosanswers logo

I used to source /opt/ros/melodic/setup.bash from my .profile; every console I open is a login console, anyway. As a first step in installing additional versions of ROS on the same PC, I wanted my environment not to source that setup.bash anymore.

I removed the related line from the .profile, and, to my amazement, every console I open still has all the ROS Melodic environment variables set. Not only that, but also two of my catkin workspaces are listed in the ROS_PACKAGE_PATH.

The same happens if I open a non-login shell (which ignores the .profile).

I have checked the .bashrc, and there is nothing sourcing a setup.bash in there.

How can I make sure that ROS Melodic env variables are not set at logon? What else should I check, to find where they are currently being set?

I am running Ubuntu 18.04 and the bash shell. Here the currently set variables:

~> printenv | grep ROS
ROS_ETC_DIR=/opt/ros/melodic/etc/ros
ROS_ROOT=/opt/ros/melodic/share/ros
ROS_MASTER_URI=http://localhost:11311
ROS_VERSION=1
ROS_PYTHON_VERSION=2
ROS_PACKAGE_PATH=/home/fanta/workspace/hrwros_ws/src:/home/fanta/workspace/hrwros_ws_cpp/src:/opt/ros/melodic/share
ROSLISP_PACKAGE_DIRECTORIES=/home/fanta/workspace/hrwros_ws/devel/share/common-lisp
ROS_DISTRO=melodic

UPDATE: logging out and in again didn't make a difference, but rebooting resolved the issue:

~> printenv | grep ROS
~>

Originally posted by fgfanta on ROS Answers with karma: 13 on 2020-01-29

Post score: 0


Original comments

Comment by Delb on 2020-01-29:
Are you sure you don't have any file that might be sourcing your workspaces/ros ? I also had something similar (having some ROS env variables set only) just to find out I forgot something in a .bash_export or even a script that was called in the bashrc.

You could try to go to your $HOME repository and run grep -r "source .*setup.bash". That may take some time but it might help you find where it's called (if it actually is).

Comment by gvdhoorn on 2020-01-29:
You could run a grep -i melodic -r $HOME and see what turns up. Note that this will search through all files in your home directory, which may not be what you want.

Comment by gvdhoorn on 2020-01-30:
Please post your last edit (update) as an answer and accept your own answer.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Logging out and in again didn't make a difference, but rebooting resolved the issue:

~> printenv | grep ROS
~>

Originally posted by fgfanta with karma: 13 on 2020-01-30

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

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