Ubuntu 23.10移除Snap安装Flatpak后出现Flatpak PPA仓库错误的求助
我的操作背景与当前状态
我把Snap完全移除后安装了Flatpak,现在通过flatpak list查看,已安装的包如下:
| 名称 | 应用ID | 版本 | 分支 | 安装位置 |
|---|---|---|---|---|
| Freedesktop Platform | org.freedesktop.Platform | 22.08.20 | 22.08 | system |
| Freedesktop Platform | org.freedesktop.Platform | 23.08.10 | 23.08 | system |
| Mesa | org.freedesktop.Platform.GL.default | 23.3.0 | 22.08 | system |
| Mesa (Extra) | org.freedesktop.Platform.GL.default | 23.3.0 | 22.08-extra | system |
| Mesa | org.freedesktop.Platform.GL.default | 23.3.2 | 23.08 | system |
| Mesa (Extra) | org.freedesktop.Platform.GL.default | 23.3.2 | 23.08-extra | system |
| openh264 | org.freedesktop.Platform.openh264 | 2.1.0 | 2.2.0 | system |
| Freedesktop SDK | org.freedesktop.Sdk | 23.08.10 | 23.08 | system |
| Greenfoot | org.greenfoot.Greenfoot | 3.8.2 | stable | system |
| Yaru-prussiangreen | org.gnome.themes.Yaru-prussiangreen | - | 3.22 | system |
| Yaru-prussiangreen-dark | org.gnome.themes.Yaru-prussiangreen-dark | - | 3.22 | system |
| KDE Application Platform | org.kde.Platform | - | 5.15-23.08 | system |
| QGnomePlatform | org.kde.PlatformTheme.QGnomePlatform | - | 5.15-23.08 | system |
| QAdwaitaDecorations | org.kde.WaylandDecoration.QAdwaitaDecorations | - | 5.15-23.08 | system |
| QGnomePlatform-decoration | org.kde.WaylandDecoration.QGnomePlatform-decoration | - | 5.15-23.08 | system |
| Firefox | org.mozilla.firefox | 121.0 | stable | system |
| Thonny | org.thonny.Thonny | 4.1.4 | stable | system |
| VLC | org.videolan.VLC | 3.0.19 | stable | system |
| Bluray Java module | org.videolan.VLC.Plugin.bdj | - | 3-23.08 | system |
| FDK-AAC Encoder | org.videolan.VLC.Plugin.fdkaac | - | 3-23.08 | system |
| Pause Click plugin | org.videolan.VLC.Plugin.pause_click | 2.2.0 | 3-23.08 | system |
我的疑问与遇到的问题
- 有点惊讶Thonny在列表里,因为当时软件中心明明显示安装失败了...
- 顺便问个小问题:
&&是不是管道符的另一种写法?我一直有点搞不清。
核心问题是,每次运行apt update都会弹出这个错误:
E: The repository 'https://ppa.launchpadcontent.net/flatpak/stable/ubuntu mantic Release' does not have a Release file.
我尝试过运行sudo add-apt-repository main restricted universe multiverse,但更新时还是报同样的错,完整的更新输出如下:
Adding component(s) 'main, restricted, universe, multiverse' to all repositories. Press [ENTER] to continue or Ctrl-c to cancel. Hit:1 http://gb.archive.ubuntu.com/ubuntu mantic InRelease Hit:2 http://gb.archive.ubuntu.com/ubuntu jammy InRelease Hit:3 http://gb.archive.ubuntu.com/ubuntu mantic-updates InRelease Hit:4 http://security.ubuntu.com/ubuntu mantic-security InRelease Hit:5 http://gb.archive.ubuntu.com/ubuntu jammy-updates InRelease Hit:6 https://repo.protonvpn.com/debian stable InRelease Hit:7 http://gb.archive.ubuntu.com/ubuntu mantic-backports InRelease Hit:8 http://security.ubuntu.com/ubuntu jammy-security InRelease Hit:9 https://packages.element.io/debian default InRelease Ign:10 https://ppa.launchpadcontent.net/flatpak/stable/ubuntu mantic InRelease Hit:11 http://gb.archive.ubuntu.com/ubuntu jammy-backports InRelease Hit:12 https://ppa.launchpadcontent.net/qbittorrent-team/qbittorrent-stable/ubuntu mantic InRelease Err:13 https://ppa.launchpadcontent.net/flatpak/stable/ubuntu mantic Release 404 Not Found [IP: 185.125.190.80 443] Reading package lists... Done E: The repository 'https://ppa.launchpadcontent.net/flatpak/stable/ubuntu mantic Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.
这个PPA应该是安装Flatpak时自动添加的,目前Flatpak本身用着还行,就是apt下载有点慢(我看资料说这是Flatpak的正常情况),偶尔会崩溃——Firefox也偶尔崩,所以我怀疑是不是缺某些系统包,但找了很多指南,都没有针对“Ubuntu 23.10完全移除Snap后Flatpak PPA报错”的情况,不确定那些通用方案适不适用。
另外移除Snap后我的网速变慢了,不过这个我打算另开提问,只是提一下不确定是否和当前问题有关。移除Snap时我用了命令阻止apt下载Snap更新,还修改了文件防止Snap更新插入到Firefox,所以肯定不是Snap相关的操作导致这个错误的。
最后还有个小问题:有没有qtube-dl或者playlist-dl的Flatpak版本?
解决方案与答疑
核心PPA错误的解决
这个错误的根源是Flatpak的stable PPA并没有为Ubuntu 23.10(mantic)提供支持,Launchpad上的这个PPA只维护到Ubuntu 22.04(jammy),所以mantic版本的Release文件根本不存在,才会触发apt报错。你可以按以下步骤修复:
- 先移除这个无效的PPA:
sudo add-apt-repository --remove ppa:flatpak/stable - 其实Ubuntu官方仓库已经自带Flatpak包了,完全不需要第三方PPA,移除后直接用官方源维护即可:
sudo apt update && sudo apt install --reinstall flatpak - 如果需要在软件中心里浏览Flatpak应用,可以安装对应的插件:
sudo apt install gnome-software-plugin-flatpak
其他疑问解答
- Thonny出现在列表里的原因:可能是你尝试安装时,Flatpak已经在后台完成了安装,但软件中心的界面状态没同步,这种小bug偶尔会发生。你可以运行
flatpak run org.thonny.Thonny测试能不能正常打开。 &&和管道符的区别:&&不是管道符哦!它的作用是只有前面的命令执行成功(返回码为0),才会执行后面的命令;而管道符|是把前面命令的输出作为后面命令的输入,两者的用途完全不同。- qtube-dl/playlist-dl的Flatpak版本:目前Flatpak官方仓库里没有这两个工具的包,不过你可以用pip安装它们(毕竟都是Python脚本),或者看看类似的替代工具——比如yt-dlp有更活跃的维护,你也可以找找它的Flatpak版本。
关于Flatpak偶尔崩溃的建议
你同时安装了22.08和23.08两个版本的Freedesktop Platform运行时,多版本运行时可能会引发冲突,导致应用崩溃。你可以运行flatpak uninstall --unused清理掉未被任何应用使用的运行时和依赖,应该能改善这种情况。
备注:内容来源于stack exchange,提问作者user1754367




