Error saying "E: This command can only be used by root." while installing docker

0 votes

I am trying to install docker with these commands:

apt-get install apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -

I get the following error:

E: This command can only be used by root.

I tried using sudo like this:

sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -

Still the same error.

Aug 6 in Docker by Vedant
129 views

1 answer to this question.

0 votes

Try executing the following command:

sudo su 

and then execute the command:

sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add 
answered Aug 6 by Ahmad

Related Questions In Docker

0 votes
1 answer
0 votes
1 answer

Error while executing docker run command

This error occurs when your port is ...READ MORE

answered Jul 26, 2018 in Docker by Kalgi
• 41,760 points
179 views
+1 vote
1 answer

Error while running docker run command

This error occurs when your port is ...READ MORE

answered Jul 26, 2018 in Docker by Kalgi
• 41,760 points
137 views
0 votes
1 answer

Error while installing Docker for windows 10

Docker for windows is compatible with only ...READ MORE

answered Oct 26, 2018 in Docker by Tyrion anex
• 8,270 points
122 views
0 votes
1 answer
0 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 56,900 points
190 views
0 votes
3 answers

Error: docker command not found

If you're using Docker as an administrator, ...READ MORE

answered Apr 29 in Docker by Naina
2,109 views
0 votes
1 answer

Create a NFS volume while creating a service - docker

Hey @Dipti, yes of course you can! ...READ MORE

answered Jul 23 in Docker by Vijay
47 views