linuxmint / mintinstall

Software Manager
137 stars 98 forks source link

Mint 21.1 Vera: mintinstall crash if flatpak is not installed #355

Open pms967 opened 1 year ago

pms967 commented 1 year ago

In Linux Mint 21.1 Vera the Mintinstall Software Manager no longer works if flatpak is not installed.

That's too bad, not everyone wants to have flatpak support packages installed on their system. Please add some check to disable flatpak support in mintinstall if flatpak is not installed on the system.

$ mintinstall
MintInstall: Detected system architecture: 'x86_64'
Traceback (most recent call last):
  File "/usr/lib/linuxmint/mintinstall/mintinstall.py", line 958, in do_activate
    if self.installer.init_sync():
  File "/usr/lib/python3/dist-packages/mintcommon/installer/installer.py", line 246, in init_sync
    if self._fp_remotes_have_changed():
  File "/usr/lib/python3/dist-packages/mintcommon/installer/installer.py", line 326, in _fp_remotes_have_changed
    fp_remotes = self.list_flatpak_remotes()
  File "/usr/lib/python3/dist-packages/mintcommon/installer/installer.py", line 492, in list_flatpak_remotes
    return _flatpak.list_remotes()
  File "/usr/lib/python3/dist-packages/mintcommon/installer/_flatpak.py", line 897, in list_remotes
    fp_sys = get_fp_sys()
  File "/usr/lib/python3/dist-packages/mintcommon/installer/_flatpak.py", line 72, in get_fp_sys
    _fp_sys = Flatpak.Installation.new_system(None)
gi.repository.GLib.GError: g-io-error-quark: While opening repository /var/lib/flatpak/repo: opening repo: opendir(/var/lib/flatpak/repo): No such file or directory (1)
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 153, in apport_excepthook
    with os.fdopen(os.open(pr_filename,
FileNotFoundError: [Errno 2] No such file or directory: '/var/crash/_usr_lib_linuxmint_mintinstall_mintinstall.py.1000.crash'

Original exception was:
Traceback (most recent call last):
  File "/usr/lib/linuxmint/mintinstall/mintinstall.py", line 958, in do_activate
    if self.installer.init_sync():
  File "/usr/lib/python3/dist-packages/mintcommon/installer/installer.py", line 246, in init_sync
    if self._fp_remotes_have_changed():
  File "/usr/lib/python3/dist-packages/mintcommon/installer/installer.py", line 326, in _fp_remotes_have_changed
    fp_remotes = self.list_flatpak_remotes()
  File "/usr/lib/python3/dist-packages/mintcommon/installer/installer.py", line 492, in list_flatpak_remotes
    return _flatpak.list_remotes()
  File "/usr/lib/python3/dist-packages/mintcommon/installer/_flatpak.py", line 897, in list_remotes
    fp_sys = get_fp_sys()
  File "/usr/lib/python3/dist-packages/mintcommon/installer/_flatpak.py", line 72, in get_fp_sys
    _fp_sys = Flatpak.Installation.new_system(None)
gi.repository.GLib.GError: g-io-error-quark: While opening repository /var/lib/flatpak/repo: opening repo: opendir(/var/lib/flatpak/repo): No such file or directory (1)
mtwebster commented 1 year ago

How have you removed flatpak? It doesn't look like it there. Did you only remove the flathub remote?

apt uninstall flatpak gir1.2-flatpak-1.0
pms967 commented 1 year ago

How have you removed flatpak?

purged the flatpak deb package...

It doesn't look like it there. Did you only remove the flathub remote? apt uninstall flatpak gir1.2-flatpak-1.0

Oh. It looks like I didn't (or possibly they've got reinstalled during some upgrade, perhaps as "soft" dependencies; I've never reinstalled the system from scratch since the first installation, years ago):

# dpkg -l|grep -i flatpak
ii  gir1.2-flatpak-1.0:amd64                    1.12.7-1                                   amd64        Application deployment framework for desktop apps (introspection)
ii  libflatpak0:amd64                           1.12.7-1                                   amd64        Application deployment framework for desktop apps (library)
ii  xdg-desktop-portal                          1.14.4-1ubuntu2~22.04.1                    amd64        desktop integration portal for Flatpak and Snap

I've purged also all of the above packages, and now mintinstall does work again.

Thank you!

BTW: I think it would still be a good idea to add some code to detect similar situations, and suggest possible solutions in the error messages (like: “re-install flatpak or remove also package xxx, yyy, ...), so that other users which may encounter this problem will know what to do.