Search code examples
ubuntu

Permission Denied while Installing Docker Machine in Ubuntu


I am new in Ubuntu and I was trying to install Docker Machine in my Ubuntu.

curl -L https://github.com/docker/machine/releases/download/v0.7.0/docker-machine-`uname -s`-`uname -m` > /usr/local/bin/docker-machine && \ chmod +x /usr/local/bin/docker-machine

When I try this code it Shows the Error

bash: /usr/local/bin/docker-machine: Permission denied

Please help me to solve the problem. Also I was just try with Sudo. But it shows the same problem. Please help. Thank you.


Solution

  • I had the same issue, fixed by running the following:

    sudo -i
    
    curl -L https://github.com/docker/machine/releases/download/v0.7.0/docker-machine-`uname -s`-`uname -m` > /usr/local/bin/docker-machine && chmod +x /usr/local/bin/docker-machine
    

    After that docker-machine appears in the /usr/local/bin/, but somehow chmod from the command above still don't work. To fix that type in the new terminal:

    sudo chmod +x /usr/local/bin/docker-machine
    
    curl -L https://github.com/docker/machine/releases/download/v0.7.0/docker-machine-`uname -s`-`uname -m` > /usr/local/bin/docker-machine && chmod +x /usr/local/bin/docker-machine
    

    and the docker-machine will be installed.