Vesselin Baev
Vesselin Baev

Reputation: 33

Install Docker script error - permission denied

I'm trying to install Docker for CentOS 7 from the documentation but I got permission denied right away:

sudo curl -sSL https://get.docker.com/ | sh
sh: line 241: /etc/yum.repos.d/docker-main.repo: Permission denied

Upvotes: 2

Views: 2081

Answers (2)

anderas
anderas

Reputation: 5854

With your command line, you are only executing curl with sudo, not sh. Try this:

su -c "curl -sSL https://get.docker.com/ | sh"

or, if it does not work, e.g. because no root password is set on your system:

sudo su -c "curl -sSL https://get.docker.com/ | sh"

Upvotes: 1

user2915097
user2915097

Reputation: 32176

the doc at https://docs.docker.com/installation/centos/ begins with "Log into your machine as a user with sudo or root privileges." I guess you should begin with a privileged user, only then you can do curl -sSL https://get.docker.com/ | sh

Upvotes: 0

Related Questions