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, 2019 in Docker by Vedant
1,143 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, 2019 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
• 51,850 points
803 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
• 51,850 points
241 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,370 points
439 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
• 57,530 points
538 views
0 votes
3 answers

Error: docker command not found

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

answered Apr 29, 2019 in Docker by Naina
5,750 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, 2019 in Docker by Vijay
375 views