Ubuntu 22.04.3下执行apt update时VSCodium仓库证书验证失败的问题求助
最近在完全更新后的Ubuntu 22.04.3上执行sudo apt update时,碰到了VSCodium仓库的证书验证失败问题,具体错误信息如下:
Err:7 https://download.vscodium.com/debs vscodium InRelease
Certificate verification failed: The certificate is NOT trusted. The name in the certificate does not match the expected. Could not handshake: Error in the certificate verification. [IP: 138.199.36.10 443]
W: Failed to fetch https://download.vscodium.com/debs/dists/vscodium/InRelease Certificate verification failed: The certificate is NOT trusted. The name in the certificate does not match the expected. Could not handshake: Error in the certificate verification. [IP: 138.199.36.10 443]
W: Some index files failed to download. They have been ignored, or old ones used instead.
针对这个问题,你可以尝试以下几个步骤来修复:
移除旧的VSCodium仓库配置和密钥,避免旧配置干扰:
依次执行以下命令:sudo rm /etc/apt/sources.list.d/vscodium.list sudo rm /usr/share/keyrings/vscodium-archive-keyring.gpg重新添加官方的VSCodium GPG密钥:
执行这条命令来获取并安装最新的验证密钥:wget -qO - https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/vscodium-archive-keyring.gpg > /dev/null添加正确的VSCodium仓库源:
把官方仓库源写入系统配置文件:echo 'deb [ signed-by=/usr/share/keyrings/vscodium-archive-keyring.gpg ] https://download.vscodium.com/debs vscodium main' | sudo tee /etc/apt/sources.list.d/vscodium.list再次执行更新命令:
现在重新运行更新,应该就能正常获取VSCodium的仓库索引了:sudo apt update
如果以上步骤还没解决问题,可以检查一下这两个点:
- 系统时间是否正确:证书验证依赖准确的系统时间,执行
sudo timedatectl set-ntp true可以同步网络时间; - 是否有代理或防火墙干扰:如果使用了代理,确保代理配置正确,不会拦截HTTPS请求的证书验证。
备注:内容来源于stack exchange,提问作者R A

