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

Rosrun tab autocompletion crashes terminal

asked 2018-10-08 07:11:27 -0600

pavel92 gravatar image

updated 2018-10-08 08:16:08 -0600

I have been using ROS Kinetic on Ubuntu 16.04 for some time now. After doing some kernel upgrades I run into a problem when running the rosrun command. When I hit the tab after writing rosrun the terminal freezes and crashes after few seconds. This does not happen for roslaunch or other ros commands. If I type the whole rosrun command with the node that I want to run it works as expected. Has anyone encountered this problem? There was a question regarding this that proposed some fixes that unfortunately did not work for me (deleting the contents of /var/crash and doing a clean build).

The output of env |grep -i ros |sort is:


where the ROS_PACKAGE_PATH contains a lot of packages, but to make it short I just put pkg1, pkg2.... in the output above.

edit retag flag offensive close merge delete


What is the output of env |grep -i ros |sort ?

Delb gravatar image Delb  ( 2018-10-08 07:55:58 -0600 )edit

I edited the question with the output

pavel92 gravatar image pavel92  ( 2018-10-08 08:16:28 -0600 )edit

Have you sourced your workspace ? The variable ROS_PACKAGE_PATH should be /home/pavel/catkin_ws/src:/opt/ros/kinetic/share

Delb gravatar image Delb  ( 2018-10-08 08:34:37 -0600 )edit

Try unset ROS_PACKAGE_PATH, and then source devel/setup.bash. Is the output the same ? (only for ROS_PACKAGE_PATH )

Delb gravatar image Delb  ( 2018-10-08 08:36:01 -0600 )edit

When I do a clean build ROS_PACKAGE_PATH gives only /opt/ros/kinetic/share . After I source the workspace I get the same package path that was shown in the question. When i unset the ROS_PACKAGE_PATH and source the workspace the package path is the same and the crash still occurs

pavel92 gravatar image pavel92  ( 2018-10-08 08:49:18 -0600 )edit

Have you modified your .bashrc ? Moreover have you run sudo apt-get update, then sudo apt-get upgrade and finally sudo apt-get autoremove ?

Delb gravatar image Delb  ( 2018-10-08 09:47:44 -0600 )edit

Did that but it did not help. I had this added in my .bashrc:

source /opt/ros/kinetic/setup.bash
source /home/pavel/catkin_ws/devel/setup.bash
pavel92 gravatar image pavel92  ( 2018-10-10 02:17:16 -0600 )edit

Can you just try to unset ROS_PACKAGE_PATH and then export ROS_PACKAGE_PATH=/home/pavel/catkin_ws/src:/opt/ros/kinetic/share (don't source your workspace after that and try the autocompletion) just to make sure the problem isn't with this variable not correctly set.

Delb gravatar image Delb  ( 2018-10-10 02:33:07 -0600 )edit

5 Answers

Sort by ยป oldest newest most voted

answered 2020-05-21 12:29:47 -0600

130s gravatar image

updated 2020-07-02 17:47:27 -0600

TLDR; Use ros-%ROS_DISTRO%-rosbash (e.g. ros-kinetic-rosbash) instead of rosbash.

Our team ran into the similar/same rosrun issue on Ubuntu 16.04 with ROS Kinetic. TLDR, we fixed by installing ros-kinetic-rosbash and removed "upstream" version of rosbash. Command-wise it was:

apt-get purge rosbash && apt-get autoremove
apt-get install ros-kinetic-rosbash

We found in our case rosrun was provided by rosbash (NOT the one hosted on

$ which rosrun

After having installed the one from, I see the path I expect:

$ which rosrun

(The reason we had the upstream rosbash installed was that we installed it manually by our mistake.)

edit flag offensive delete link more

answered 2019-09-04 04:23:58 -0600

Anchellon gravatar image

Reinstalling ROS bash worked for me

sudo apt-get install --reinstall ros-kinetic-rosbash
edit flag offensive delete link more


I tried that but no luck so far

pavel92 gravatar image pavel92  ( 2019-09-18 03:35:39 -0600 )edit

answered 2019-06-22 10:25:47 -0600

Maybe a stupid solution but in my case uninstalling and reinstalling Ros helped.

sudo apt-get purge ros-kinetic-*

and then following the tutorial for installing again

edit flag offensive delete link more


I am aware that this is one of the solution but I am trying to pinpoint the source of the problem and avoid reinstalling ROS

pavel92 gravatar image pavel92  ( 2019-09-18 02:44:22 -0600 )edit

answered 2020-07-23 05:06:43 -0600

In my case, I just had a large amount of files in the package (was a neural network with many versions and logs). Removing unnecessary files fixed this.

edit flag offensive delete link more

answered 2020-07-02 07:56:32 -0600

Rebuilding my workspace worked for me:

catkin clean --yes -all

catkin build

edit flag offensive delete link more

Question Tools



Asked: 2018-10-08 07:11:27 -0600

Seen: 1,706 times

Last updated: Jul 02 '20