错误日志为:
1 package can be upgraded. Run 'apt list --upgradable' to see it.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://pkg.jenkins.io/debian-stable binary/ Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7198F4B714ABFC68
W: Failed to fetch https://pkg.jenkins.io/debian-stable/binary/Release.gpg The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7198F4B714ABFC68
W: Some index files failed to download. They have been ignored, or old ones used instead.
root@ns524146:~# curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2026.key | sudo tee \
问题和解决
上面问题的原因是 Jenkins key 安装和更新的问题。
根据文章:Jenkins 2.543 and 2.541.1: New Linux Repository Signing Keys 中的内容。
需要运行下面命令:
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2026.key | sudo tee \
/usr/share/keyrings/jenkins-keyring.asc > /dev/null
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
/etc/apt/sources.list.d/jenkins.list > /dev/null
当运行完上面的命令后,再次更更新即可。

