I was installing Docker Engine on Ubuntu 22.04 using the following link https://docs.docker.com/engine/install/ubuntu/, everything was okay until I reach sudo apt-get update, it gives me the following error:
E: Conflicting values set for option Signed-By regarding source https://download.docker.com/linux/ubuntu/ jammy: /etc/apt/keyrings/docker.gpg != E: The list of sources could not be read. I had to edit the permission for this file:
$ sudo chmod a+r /etc/apt/keyrings/docker.gpg $ cd /etc/apt/keyrings $ ls -la drwxr-xr-x 2 root root 4096 Jan 16 23:43 . drwxr-xr-x 8 root root 4096 Jan 17 00:33 .. -rw-r--r-- 1 root root 2760 Jan 16 23:43 docker.gpg But the error is still found, what should I do?
I attempted to delete the keyrings directory,
sudo rm -r ./keyrings and the sudo apt update error is still found:
sudo apt update E: Conflicting values set for option Signed-By regarding source https://download.docker.com/linux/ubuntu/ jammy: /etc/apt/keyrings/docker.gpg != E: The list of sources could not be read. the output of ls -l /etc/apt/sources.list.d
total 36 -rw-r--r-- 1 root root 96 Dec 10 21:30 archive_uri-http_dl_openfoam_org_ubuntu-jammy.list -rw-r--r-- 1 root root 96 Dec 10 19:29 archive_uri-http_dl_openfoam_org_ubuntu-jammy.list.save -rw-r--r-- 1 root root 72 Dec 10 21:30 download_docker_com_linux_ubuntu.list -rw-r--r-- 1 root root 72 Dec 10 19:29 download_docker_com_linux_ubuntu.list.save -rw-r--r-- 1 root root 70 Dec 10 21:30 gazebo-stable.list -rw-r--r-- 1 root root 70 Dec 10 19:29 gazebo-stable.list.save -rw-r--r-- 1 root root 0 Dec 15 23:43 official-source-repositories.list -rw-r--r-- 1 root root 248 Dec 10 19:29 official-source-repositories.list.save -rw-r--r-- 1 root root 118 Dec 10 21:31 ros2.list -rw-r--r-- 1 root root 118 Dec 10 19:29 ros2.list.save
sudo apt update(if it's necessary 2)sudo apt upgrade(if it's necessary) 3)sudo apt install docker. Or do you have/want to install the docker package provided by Docker Community (docker-ce)?sudo rm /etc/apt/keyrings/docker.gpg /etc/apt/sources.list.d/docker.list. and after that runsudo apt updateandsudo apt install docker