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

mkdir -p /catkin_ws/src is not working

asked 2021-02-10 06:25:28 -0500

andreatesta gravatar image

updated 2021-02-10 06:53:23 -0500

gvdhoorn gravatar image

Hi everyone, I have just installed ROS noetic on Ubuntu 20.04 LTS using multimass (so I am in a virtual enviroment in windows).

I am folowing the ROS tutorial step by step and after the installation there is the creation of a Workspace using catkin, but the first command to do that ("mkdir -p /catkin_ws/src") doesn't work.

The response is:

mkdir: cannot create directory ‘/catkin_ws’: Permission denied

How can I fix that?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2021-02-10 06:52:58 -0500

gvdhoorn gravatar image
mkdir -p /catkin_ws/src

you're missing the ~ (or tilde), which refers to your home directory on Linux.

Right now you're trying to create a directory in the root of your filesystem, which is typically not something you can do as an ordinary user.

You'll want to run something like this:

mkdir -p ~/catkin_ws/src

or (equivalent):

mkdir -p $HOME/catkin_ws/src
edit flag offensive delete link more



Thanks a lot! Actually in the tutorial the ~ was present but I cannot write it in Windows powershell (even copying and pasting it doesn't appear). With $HOME instead it works!!!

andreatesta gravatar image andreatesta  ( 2021-02-10 09:02:09 -0500 )edit

The tutorials will assume you're using Bash, so I'm not surprised the commands don't work for you in PowerShell.

I'm also slightly confused how you're using PowerShell on Ubuntu.

gvdhoorn gravatar image gvdhoorn  ( 2021-02-10 10:27:49 -0500 )edit

I am not on Ubuntu, but on Windows 10. To create the virtual machine needed to generate an Ubuntu enviroment I used Multipass. So Windows Powershell is available.

andreatesta gravatar image andreatesta  ( 2021-02-10 12:22:44 -0500 )edit

Multipass creates VMs afaict. So it's still Ubuntu that's eventually running.

You state so yourself as well.

gvdhoorn gravatar image gvdhoorn  ( 2021-02-10 12:58:50 -0500 )edit

Yes but the terminal where I am writing remains the same, the tops rows are still:

    Windows PowerShell
    Copyright (C) Microsoft Corporation. Tutti i diritti riservati.

    Prova la nuova PowerShell multipiattaforma

    PS C:\Users\Utente>
andreatesta gravatar image andreatesta  ( 2021-02-11 03:23:35 -0500 )edit

Question Tools


Asked: 2021-02-10 06:25:28 -0500

Seen: 1,054 times

Last updated: Feb 10 '21