如何手动卸载Snap软件包?

我正在尝试移除一个名为leagueoflegends的snap包,但是我遇到了以下错误:
error: cannot perform the following tasks:
- Disconnect leagueoflegends:desktop-legacy from core:desktop-legacy (internal error: connection "leagueoflegends:desktop-legacy core:desktop-legacy" not found in state)
- Disconnect leagueoflegends:wine-4-staging from wine-platform-4-staging:wine-4-staging (cannot setup apparmor for snap "leagueoflegends": cannot load apparmor profiles: exit status 10
apparmor_parser output:
)
- Disconnect leagueoflegends:wine-4-staging from wine-platform-4-staging:wine-4-staging (cannot load apparmor profiles: exit status 10
apparmor_parser output:
)
- Disconnect leagueoflegends:home from core:home (cannot setup apparmor for snap "leagueoflegends": cannot load apparmor profiles: exit status 10
apparmor_parser output:
)
- Disconnect leagueoflegends:home from core:home (cannot load apparmor profiles: exit status 10
apparmor_parser output:
)
- Disconnect leagueoflegends:icon-themes from gtk-common-themes:icon-themes (cannot setup apparmor for snap "leagueoflegends": cannot load apparmor profiles: exit status 10
apparmor_parser output:
)
- Disconnect leagueoflegends:icon-themes from gtk-common-themes:icon-themes (cannot load apparmor profiles: exit status 10
apparmor_parser output:
)

我尝试从存储snap软件包的所有文件夹中删除它,除了/snap/leagueoflegends文件夹外。在那里,我遇到了写保护错误:"无法删除... "只读文件系统"。

3显示错误消息但不提供产生该消息的命令并没有太多意义。那么你是如何尝试移除这个快照的呢?听起来像是你手动删除了文件... - mook765
不,我首先尝试使用“snap remove leagueoflegends”命令,并显示了我已经粘贴的错误信息,然后我尝试手动删除它。 - Omar Hossam Ahmed
1个回答

你可能已经创建了一个问题,如果你按照指示删除文件。
处理snap软件包的“正常”方式是通过snap实用程序。我在下面包含了帮助文本和示例,以便让你了解如何使用。

如何解决你所创建的情况,很难说清楚。
我建议你执行snap list来查找你想要删除的软件包的实际名称,然后尝试sudo snap remove packagename - 针对该软件包。

如果显示错误,则需要以合理的方式处理这些错误。


一些关于“snap”使用的提示... $ snap list <列出已安装的软件包> $ snap help snap命令允许您安装、配置、更新和删除snaps。Snaps是可以在许多不同的Linux发行版上工作的软件包,可以安全地交付和操作最新的应用程序和实用工具。
用法:snap [...]
- - - 8<- - - - -
要获取有关某个命令的更多信息,请运行'snap help '。 要获取所有命令的简短摘要,请运行'snap help --all'。 $ snap help remove 用法: snap remove [remove-OPTIONS] ...
remove命令从系统中删除指定的snap实例。
默认情况下,所有snap修订版本都会被删除,包括它们的数据和公共数据目录。当传递--revision选项时,只会删除指定的修订版本。
[remove命令选项] --no-wait 不等待操作完成,只打印更改ID。 --revision= 仅删除给定的修订版本 $ sudo snap remove ... 请注意,至少需要“core”才能使snap正常运行... 对于其他软件包,我不太确定,它们可能也是必需的。 $ snap list 名称 版本号 Rev 跟踪 发布者 备注 core 16-2.39.3 7270 稳定 canonical✓ 核心 core18 20190709 1066 稳定 canonical✓ 基础 gtk-common-themes 0.1-22-gab0a26b 1313 稳定 canonical✓ - gtk2-common-themes 0.1 5 稳定 canonical✓ -

... 安装例如 gimp 或 vlc 每次添加一行。