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.