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

How do I ensure the shell doesn't set ROS Melodic env variables anymore? (Linux)

asked 2020-01-29 08:40:22 -0500

fgfanta gravatar image

updated 2020-01-30 04:34:30 -0500

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
~>
edit retag flag offensive close merge delete

Comments

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).

Delb gravatar image Delb  ( 2020-01-29 09:12:19 -0500 )edit

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.

gvdhoorn gravatar image gvdhoorn  ( 2020-01-29 09:22:11 -0500 )edit
1

Please post your last edit (update) as an answer and accept your own answer.

gvdhoorn gravatar image gvdhoorn  ( 2020-01-30 04:35:25 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-01-30 06:40:04 -0500

fgfanta gravatar image

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

~> printenv | grep ROS
~>
edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2020-01-29 08:40:22 -0500

Seen: 515 times

Last updated: Jan 30 '20