关于隐藏PPA的安全性及Beyond Compare源签名验证失败且源不可见的问题
我完全理解你的困惑——明明手动安装了Scooter Software的Beyond Compare,结果apt update时弹出了签名验证错误,而且在"Software & Updates"图形界面和/etc/apt/sources.list里都找不到对应的源,换谁都会担心是不是有隐藏的不安全源在后台运行。咱们一步步拆解解决这个问题:
一、先解决签名验证失败的问题
这个报错的核心是系统缺少Beyond Compare官方源对应的公钥,你可以通过以下命令手动添加:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EC34ED227AFAE3F2
添加完成后再运行sudo apt update,签名验证的问题应该就能解决了。
二、为什么源不在/etc/apt/sources.list和GUI里?
很多第三方软件(包括Beyond Compare)不会直接修改系统默认的/etc/apt/sources.list文件,而是会在**/etc/apt/sources.list.d/目录下创建单独的.list配置文件**。你可以用这条命令查看所有这类隐藏的源文件:
ls /etc/apt/sources.list.d/
你大概率会在这里找到一个类似scootersoftware.list的文件,这就是Beyond Compare的源配置文件。
至于为什么在"Software & Updates"GUI里看不到它:因为这个工具通常只识别标准格式的PPA源(比如ppa:xxx/xxx这种),而Beyond Compare的源是直接添加的第三方HTTP源,不符合GUI工具的识别规则,所以才会"隐藏"起来,但它确实是你安装软件时官方自动添加的合法源。
三、关于隐藏源的安全性问题
你的担心非常合理,但这个源本身是安全的——它是你安装Beyond Compare时官方安装包自动配置的。不过平时确实要养成几个好习惯来维护源的安全:
- 定期检查
/etc/apt/sources.list.d/目录,确认所有.list文件都是你自己安装软件时添加的 - 不要随意安装来源不明的软件包,避免恶意源被偷偷植入
- 如果发现陌生的源文件,直接删除它,然后运行
sudo apt update即可刷新源列表
附你遇到的完整报错日志:
Ign:17 https://www.scootersoftware.com bcompare4 InRelease
Get:18 https://www.scootersoftware.com bcompare4 Release [1 731 B]
Get:19 https://www.scootersoftware.com bcompare4 Release.gpg [836 B]
Err:19 https://www.scootersoftware.com bcompare4 Release.gpg
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EC34ED227AFAE3F2
Fetched 327 kB in 1s (219 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up-to-date.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://www.scootersoftware.com bcompare4 Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EC34ED227AFAE3F2
W: Failed to fetch https://www.scootersoftware.com/dists/bcompare4/Release.gpg The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EC34ED227AFAE3F2
W: Some index files failed to download. They have been ignored, or old ones used instead.
备注:内容来源于stack exchange,提问作者user105939

