为有关源的选项“签名者”设置的值存在冲突

为有关源的选项“签名者”设置的值存在冲突

我使用以下链接在 Ubuntu 22.04 上安装 Docker Enginehttps://docs.docker.com/engine/install/ubuntu/,一切都很好,直到我到达sudo apt-get 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.

我必须编辑该文件的权限:

$ 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

但还是发现错误,怎么办?

我试图删除 keyrings 目录,

sudo rm -r ./keyrings

并且仍然发现 sudo apt update 错误:

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.

的输出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

答案1

重要的:这个答案没有解决如何安装泊坞窗。相反,它确实解决了如何避免命令给出的错误:sudo apt-get update添加 docker 存储库时:

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.

解决方案

您必须删除以下文件:

sudo rm /etc/apt/keyrings/docker.gpg
sudo rm /etc/apt/sources.list.d/docker.list

如果有人不断收到相同的错误,那么应该删除以下文件:

cd /etc/apt/sources.list.d
sudo rm download_docker_com_linux_ubuntu.list download_docker_com_linux_ubuntu.list.save

答案2

我也有同样的

E:为有关源的选项“签名者”设置的值冲突https://download.docker.com/linux/ubuntu/jammy: /etc/apt/keyrings/docker.asc != /etc/apt/trusted.gpg.d/docker.asc, E:无法读取源列表。

翻出了文件

管理:///etc/apt/sources.list.d/download_docker_com_linux_ubuntu.list

有一个双重条目:

德布https://download.docker.com/linux/ubuntu焦点稳定

deb [arch=amd64 签名者=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu杰米马厩

deb [arch=amd64 签名者=/etc/apt/trusted.gpg.d/docker.asc]https://download.docker.com/linux/ubuntu杰米马厩

通过在第二行前面加上“#”(因为它是双倍的)前缀来注释掉它,为我修复了它。在那之后

sudo apt-get 更新

又工作了

相关内容