如何禁止安装 snap 包?

如何禁止安装 snap 包?

我正在尝试禁止使用以下命令安装 snap 包/etc/apt/preferences.d/pin

Package: *
Pin: version *snap*
Pin-Priority: -10

但它不起作用。

答案1

创建/etc/apt/preferences.d/99-Prohibit-Snapd文件并添加以下内容:

Package: snapd
Pin: release a=*
Pin-Priority: -10

此配置snapd完全禁止安装。因此,任何依赖它的包都将无法安装,并会返回此错误消息:

The following packages have unmet dependencies:
 some-package: PreDepends: snapd but it is not installable
E: Unable to correct problems, you have held broken packages.

相关内容