在下载 ros2 软件包时,我正在更新我的 apt 存储库缓存sudo apt update
,我得到以下输出,其中E:存储库“http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease”未签名。我知道 Xenial (16.04) 存储库对于 22.04 不是必需的,我从(软件和更新 > 其他软件)中删除了它,但错误尚未解决,所以我需要您的帮助。
Hit:1 http://www-ftp.lip6.fr/pub/linux/distributions/Ubuntu/archive jammy InRelease
Hit:2 http://dl.openfoam.org/ubuntu jammy InRelease
Hit:3 http://www-ftp.lip6.fr/pub/linux/distributions/Ubuntu/archive jammy-updates InRelease
Hit:4 http://www-ftp.lip6.fr/pub/linux/distributions/Ubuntu/archive jammy-backports InRelease
Hit:5 https://download.docker.com/linux/ubuntu jammy InRelease
Get:6 http://security.ubuntu.com/ubuntu xenial-security InRelease [99.8 kB]
Hit:7 http://www-ftp.lip6.fr/pub/linux/distributions/Ubuntu/archive jammy-security InRelease
Hit:8 http://packages.ros.org/ros2/ubuntu jammy InRelease
Hit:9 http://packages.osrfoundation.org/gazebo/ubuntu-stable jammy InRelease
Get:10 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [99.8 kB]
Err:6 http://security.ubuntu.com/ubuntu xenial-security InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
Err:10 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
Reading package lists... Done
W: http://dl.openfoam.org/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: https://download.docker.com/linux/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: http://packages.osrfoundation.org/gazebo/ubuntu-stable/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://security.ubuntu.com/ubuntu xenial-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
E: The repository 'http://security.ubuntu.com/ubuntu xenial-security 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: http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
E: The repository 'http://us.archive.ubuntu.com/ubuntu xenial-updates 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.
查找 /etc/apt -type f -exec grep xenial {}+
/etc/apt/sources.list.d/official-source-repositories.list.save:deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
/etc/apt/sources.list.d/official-source-repositories.list.save:deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
/etc/apt/sources.list.d/official-source-repositories.list.save:deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
/etc/apt/sources.list.d/official-source-repositories.list:deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
/etc/apt/sources.list.d/official-source-repositories.list:# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
/etc/apt/sources.list.d/official-source-repositories.list:deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
答案1
您的源代码中仍然定义了 xenial 存储库。编辑/etc/apt/sources.list.d/official-source-repositories.list
并删除任何引用 xenial 的行。这不仅会使警告消失,而且可能会阻止安装不需要的软件包。