curl -fsSL https://get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh
it shows
E: Conflicting values set for option Signed-By regarding source https://download.docker.com/linux/debian/ bullseye: /etc/apt/keyrings/docker.gpg !=
E: The list of sources could not be read.
I ran into this problem yesterday. I had to make two changes to the cookbook:
The sudo gpg needs an H-flag: curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo -H gpg --dearmor -o /etc/apt/keyrings/docker.gpg
The $(lsb_release -cs) didn’t work for me so I had to hardcode my current ubuntu version: echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu bionic stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
@sundit your fix helped but since I’m on debian I had to do something else.
I also discovered that /etc/apt/keyrings didn’t exist so I had to manually create this before running mkdir /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/debian/gpg | sudo -H gpg --dearmor -o /etc/apt/keyrings/docker.gpg
and then reran curl -fsSL https://get.docker.com -o get-docker.sh
After doing this, apt update && apt upgrade -y worked without errors.
I am on debian 12 bookworm. In my case etc/apt/keyrings exists but contains docker.asc:
root@docker-registry-LXC /etc/apt# cd /etc/apt/keyrings
root@docker-registry-LXC …/apt/keyrings# ls
docker.asc
nevertheless when I run the first scripts suggested by docker (without sudo since I am installing in a LXC) I get the following error message:
E: The repository ‘Index of linux/ubuntu/ bookworm Release’ does not have a Release file.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
ca-certificates is already the newest version (20230311).
curl is already the newest version (7.88.1-10+deb12u5).
0 upgraded, 0 newly installed, 0 to remove and 56 not upgraded.