root@6c45ca8f7aff:/home/yby# sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg |
sudo gpg --dearmor -o /etc/apt/keyrings/docker.asc
root@6c45ca8f7aff:/home/yby# sudo apt update
Get:1 http://mirrors.tuna.tsinghua.edu.cn/ros2/ubuntu jammy InRelease [4682 B]
Err:1 http://mirrors.tuna.tsinghua.edu.cn/ros2/ubuntu jammy InRelease
The following signatures were invalid: EXPKEYSIG F42ED6FBAB17C654 Open Robotics info@osrfoundation.org
Hit:2 https://mirrors.ustc.edu.cn/ubuntu jammy InRelease
Hit:3 https://mirrors.ustc.edu.cn/ubuntu jammy-updates InRelease
Hit:4 https://mirrors.ustc.edu.cn/ubuntu jammy-backports InRelease
Get:5 https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal InRelease [57.7 kB]
Hit:6 https://mirrors.ustc.edu.cn/ubuntu jammy-security InRelease
Err:5 https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8
Reading package lists... Done
W: http://mirrors.tuna.tsinghua.edu.cn/ros2/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: GPG error: http://mirrors.tuna.tsinghua.edu.cn/ros2/ubuntu jammy InRelease: The following signatures were invalid: EXPKEYSIG F42ED6FBAB17C654 Open Robotics info@osrfoundation.org
E: The repository 'http://mirrors.tuna.tsinghua.edu.cn/ros2/ubuntu jammy InRelease' is not signed.
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.
W: GPG error: https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8
E: The repository 'https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal InRelease' is not signed.
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.
root@6c45ca8f7aff:/home/yby# ^C
root@6c45ca8f7aff:/home/yby#
按照教程一键安装docker+ros,在sudo apt update时出现问题,显示ros2所用的清华源已经过期。因为不知道如何修改容器里的ros源,所以想着修改docker源,修改后觉得不太对。
尝试过的解决方法:修改 Docker 源为阿里云(Ubuntu 20.04)
编辑 docker.listbash
复制
sudo nano /etc/apt/sources.list.d/docker.list 替换为阿里云 Docker CE 源
把原来的:
deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.asc] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu focal stable
改成:
deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.asc] https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal stable
注意:保留 signed-by=/etc/apt/keyrings/docker.asc,确保用的是官方 GPG 密钥。