You are getting a Permission denied
error because you do not have access rights to create a directory in /usr/local
. You can determine the access rights for these directories by using the stat
command. The output will look something like this.
$> stat -c '%n %A %G %U' /usr /usr/local
/usr drwxr-xr-x root root
/usr/local drwxr-xr-x root root
Now double check who you are. You can use the whoami
command or the id
command invoked below twice to reveal both username and group.
$> id -un; id -gn
In the stat
output, root:root
owns both /usr
and /usr/local
and only the owner may create (write) new directories based on the access rights. In order to create the directories, I'd recommend either becoming root
or trying the command with sudo
. If this is not possible, I'm afraid you'll have to create the directory elsewhere or contact the administrator of that machine.