sudo apt-get install chromium-browser 由于某种原因安装的不是一个合适的 apt-get 包而是 Installing the chromium snap
我知道阻止这样的安装不会神奇地建立一个维护的包,并且会导致安装失败。但我更喜欢获取错误并手动安装 - 从源代码或在不太可能的情况下从 snap 安装。
我不想使用 snap 安装任何东西(首先,由于 Snap Store 闭源实践)。特别是当我使用apt-get.
如何在 gnome 软件中心禁用快照?没有回答我的问题,因为我想摆脱快速感染apt- 而不是在 gnome-software-center 中。
van*_*ium 14
您不能停止apt安装 snap 包,因为它不是apt,而是触发 snap 安装的单个deb包(在这种情况下chromium-browswer)。所以apt它自己无法控制:这是由可用包控制的。
因此,您需要在安装它们之前检查它们,如果它们看起来很快就会被拉动,请不要安装它们。
要完全阻止 apt 安装 snap 包,您实际上需要完全禁用和删除 snap。这是完全安全的:您的系统无需快速运行即可正常运行。作为 snap 安装的少数默认工具,例如系统监视器、字符和快照存储,可以很容易地替换为它们的 .deb 对应物。
N0r*_*ert 12
您必须通过以下方式从系统中删除 snapd
sudo apt-get autopurge snapd
Run Code Online (Sandbox Code Playgroud)
然后为 APT 创建特殊的配置文件,就像 LinuxMint所做的那样:
cat <<EOF | sudo tee /etc/apt/preferences.d/nosnap.pref
# To prevent repository packages from triggering the installation of Snap,
# this file forbids snapd from being installed by APT.
# For more information: https://linuxmint-user-guide.readthedocs.io/en/latest/snap.html
Package: snapd
Pin: release a=*
Pin-Priority: -10
EOF
Run Code Online (Sandbox Code Playgroud)
这将阻止将来安装 Snaps。
除了在 中设置文件之外/etc/apt,您还可以在 purge snapd 之后运行apt-mark以阻止安装任何需要安装的内容:snapd
$ sudo apt-mark hold snapd
Run Code Online (Sandbox Code Playgroud)
例如,firefox在 Ubuntu 22.04(这是一个基于 snapd 的软件包)中安装会出现错误:
$ sudo apt install firefox
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
firefox : PreDepends: snapd but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Run Code Online (Sandbox Code Playgroud)
打破这个规则的唯一方法是明确地做到这一点:
$ sudo apt install snapd
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
snapd
The following held packages will be changed:
snapd
0 upgraded, 1 newly installed, 0 to remove and 11 not upgraded.
Need to get 23.8 MB of archives.
After this operation, 102 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Run Code Online (Sandbox Code Playgroud)
另外,您可以通过以下方式撤消效果:
$ sudo apt-mark unhold snapd
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1533 次 |
| 最近记录: |