# Safely rename catkin_ws to fix typo

This is dumb question maybe but before I mess up my environment I want to ask it.

First of all I know that the name of the directory doesn't really matter. But because I am using shared bash scripts it matters to me.

I accidentally type caktin_ws and have been living with this typo. But now it's causing problems. If I rename caktin_ws to catkin_ws, what else do I need to do?

I think I delete catkin_ws/build and then do a catkin_make it should clean everything up again. But before I try I thought I would ask here!

Also even if that's a technique, is there a better, quicker way than recompiling everything?

edit retag close merge delete

Sort by » oldest newest most voted

Looking at the contents of catkin_ws/devel there seems to be absolute paths everywhere. You can try to sed 's/caktin_ws/catkin_ws/g' on every file inside your workspace's build and devel folders but I think there is no better option than recompiling everything.

I would recommend you to do the following on a terminal where you haven't sourced caktin_ws/devel/setup.bash

mv caktin_ws catkin_ws
cd catkin_ws
rm -rf build devel
catkin_make
source devel/setup.bash
rospack profile


Don't forget to add the correct source ~/catkin_ws/devel/setup.bash to your ~/.bashrc file if you don't want to source the workspace manually every time you open a console.

more

1

Just an observation: the suggested steps are essentially the steps you'd do to rebuild a Catkin workspace.

As far as the build tools are concerned, renaming your workspace root directory essentially just means you've created "a new workspace", and consequently you should perform the same steps.

And if you happen to also have an install space, be sure to remove that as well.

( 2020-09-11 00:46:59 -0600 )edit