Flatpak安装及使用

Ubuntu 安装步骤:

Ubuntu 18.04之前版本安装:

sudo add-apt-repository ppa:alexlarsson/flatpak
sudo apt update
sudo apt install flatpak

Ubuntu 18.04以后版本安装:

sudo apt install flatpak

三种Flatpak安装应用程序方法

    1. 使用GNOME软件中心安装Flatpak应用
      #如果是GNOME桌面 
      sudo apt install gnome-software-plugin-flatpak 
      #如果是KDE桌面 
      sudo apt install plasma-discover-backend-flatpak
    2. 使用.flatpakref文件安装Flatpak应用
      #下载flatpackref文件:
      https://flathub.org/apps
      #安装:
      flatpak install --from /path/to/<app-id>.flatpakref
      #运行:
      flatpak run <app-id>
      #卸载:
      flatpak uninstall <app-id>
    3. 使用命令行安装Flatpak应用
      #添加Flathub仓库: 
      flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
      #搜索软件: 
      flatpak search app-name
      #安装软件: 
      flatpak install flathub <app-id>
      #比如: 
      sudo flatpak install flathub org.cloudcompare.CloudCompare
      
      #运行: 
      flatpak run <app-id>
      #卸载: 
      flatpak uninstall <app-id>

问题1:
Ubuntu 16.04 添加Flathub仓库报错
error: Can’t load uri https://flathub.org/repo/flathub.flatpakrepo: Unacceptable TLS certificate
解决方案1:
#重新安装CA证书

sudo apt install --reinstall ca-certificates
#解决方案1不适合我

解决方案2:
更换为上海交大镜像源:

sudo flatpak remote-add --if-not-exists sjtu https://mirror.sjtu.edu.cn/flathub/flathub.flatpakrepo

参考:
官网
应用商店