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
6,854 views
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

1 answer to this question.

+1 vote

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
• 52,350 points
3,814 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
• 52,350 points
1,862 views
0 votes
2 answers

Error while installing Docker for windows 10

RUN cmd as administrator then check use ...READ MORE

answered Aug 26, 2020 in Docker by Pistle
• 1,000 points
2,776 views
+2 votes
1 answer
+2 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
• 58,100 points
2,687 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
16,358 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 24, 2019 in Docker by Vijay
1,415 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP