SiiWay ImgAPI
392 字
2 分钟
Ubuntu without Snap
省流 (Ubuntu 20+)
点击展开
下面的代码将会:
- 删除 Snapd
- 防止 Snapd 被重新安装
- 添加 Mozilla PPA
- 固定 Firefox & Thunderbird 版本
- 安装 PPA 版 Firefox & Thunderbird
当然,我还是建议你分步操作的 (否则出错了都不知道是哪一步)
# 1sudo apt purge snapd -ysudo apt autoremove -y# 2echo 'Package: snapdPin: release a=*Pin-Priority: -10
Package: *snap*Pin: release a=*Pin-Priority: -10' | sudo tee /etc/apt/preferences.d/nosnap# 3sudo add-apt-repository ppa:mozillateam/ppa -y# 4echo 'Package: firefox*Pin: release o=LP-PPA-mozillateamPin-Priority: 32767
Package: thunderbird*Pin: release o=LP-PPA-mozillateamPin-Priority: 32767' | sudo tee /etc/apt/preferences.d/mozillateamppa# 5sudo apt install firefox thunderbird thunderbird-gnome-support -y执行完建议重启
干掉 Snap
卸载 Snap 本体:
sudo apt purge snapdsudo apt autoremove
执行完后 reboot 重启
阻止 Snap 死灰复燃
也很简单,编辑 /etc/apt/preferences.d/nosnap 写入以下内容:
Package: snapdPin: release a=*Pin-Priority: -10
Package: *snap*Pin: release a=*Pin-Priority: -10查看 apt policy snapd, 策略应该会阻止 snapd 和所有带 snap 关键词的包安装 (优先级 -10)
此时执行 sudo apt install snapd 应该会被阻止:

切换到 Firefox & Thunderbird PPA
首先,添加 Firefox & Thunderbird 的 PPA 源 (两软件在同一个源):
sudo add-apt-repository ppa:mozillateam/ppa
接下来,编辑 /etc/apt/preferences.d/mozillateamppa,写入以下内容:
Package: firefox*Pin: release o=LP-PPA-mozillateamPin-Priority: 32767
Package: thunderbird*Pin: release o=LP-PPA-mozillateamPin-Priority: 32767保存退出,执行 apt policy, 应该看到我们新添加的 PPA 源优先级高于 Snap 版:

安装 firefox:
sudo apt install firefox安装 thunderbird (邮件客户端):
sudo apt install thunderbird thunderbird-gnome-support# thunderbird-gnome-support 是我 apt install 时看到 "建议安装" 的,就顺手加上了 Ubuntu without Snap
https://wyf9.top/posts/ubuntu-nosnap/