Help on purging flatpak  [Solved]

Help for Current Versions of MX
When asking for help, use Quick System Info from MX Tools. It will be properly formatted using the following steps.
1. Click on Quick System Info in MX Tools
2. Right click in your post and paste.
Message
Author
User avatar
MikeR
Posts: 195
Joined: Sun Jun 25, 2023 6:42 am

Help on purging flatpak

#1 Post by MikeR »

For reasons[*] I would like to remove flatpak (which I have never used, and do not plan on ever using)
from my system.
I tried sudo apt purge flatpak which seemed to be successful, however:
1. on running sudo updatedb and then locate flatpak there is a long list of flatpak-related files
2. running sudo apt full-upgrade outputs:

Code: Select all

$ sudo apt full-upgrade
[sudo] password for mike:             
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
  flatpak libostree-1-1
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,721 kB of archives.
After this operation, 8,455 kB of additional disk space will be used.
Do you want to continue? [Y/n] n
Can anyone help me get rid of this aesthetically displeasing program?
Thanks for your suggestions,
Mike
[*] Too complicated, not KISS, top-heavy, and in my case, useless.

system information appended;

Code: Select all

Snapshot created on: 20250413_0816
System:
  Kernel: 6.1.0-33-amd64 [6.1.133-1] arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
    parameters: BOOT_IMAGE=/boot/vmlinuz-6.1.0-33-amd64 root=UUID=<filter> ro quiet
    nvme_core.default_ps_max_latency_us=0 splash
  Desktop: GNOME v: 43.9 info: gnome-panel wm: Metacity v: 3.46.1 dm: LightDM v: 1.32.0
    Distro: MX-23.6_x64 Libretto June 26 2024 base: Debian GNU/Linux 12 (bookworm)
Machine:
  Type: Desktop System: HP product: HP ProDesk 400 G4 DM (TAA) v: SBKPF
    serial: <superuser required> Chassis: type: 6 serial: <superuser required>
  Mobo: HP model: 83F3 v: KBC Version 07.D2.00 serial: <superuser required> UEFI: HP
    v: Q23 Ver. 02.25.00 date: 09/28/2023
CPU:
  Info: model: Intel Core i5-8500T bits: 64 type: MCP arch: Coffee Lake gen: core 8 level: v3
    note: check built: 2018 process: Intel 14nm family: 6 model-id: 0x9E (158) stepping: 0xA (10)
    microcode: 0xFA
  Topology: cpus: 1x cores: 6 smt: <unsupported> cache: L1: 384 KiB desc: d-6x32 KiB; i-6x32 KiB
    L2: 1.5 MiB desc: 6x256 KiB L3: 9 MiB desc: 1x9 MiB
  Speed (MHz): avg: 800 min/max: 800/3500 scaling: driver: intel_pstate governor: powersave
    cores: 1: 800 2: 800 3: 800 4: 800 5: 800 6: 800 bogomips: 25199
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: gather_data_sampling mitigation: Microcode
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT disabled
  Type: mds mitigation: Clear CPU buffers; SMT disabled
  Type: meltdown mitigation: PTI
  Type: mmio_stale_data mitigation: Clear CPU buffers; SMT disabled
  Type: reg_file_data_sampling status: Not affected
  Type: retbleed mitigation: IBRS
  Type: spec_rstack_overflow status: Not affected
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 mitigation: IBRS; IBPB: conditional; STIBP: disabled; RSB filling;
    PBRSB-eIBRS: Not affected; BHI: Not affected
  Type: srbds mitigation: Microcode
  Type: tsx_async_abort mitigation: TSX disabled
Graphics:
  Device-1: Intel CoffeeLake-S GT2 [UHD Graphics 630] vendor: Hewlett-Packard driver: i915
    v: kernel arch: Gen-9.5 process: Intel 14nm built: 2016-20 ports: active: DP-1 empty: DP-2,
    DP-3, HDMI-A-1, HDMI-A-2 bus-ID: 00:02.0 chip-ID: 8086:3e92 class-ID: 0300
  Device-2: Jieli USB PHY 2.0 type: USB driver: snd-usb-audio,uvcvideo bus-ID: 1-2.3:42
    chip-ID: 1224:2a25 class-ID: 0102
  Display: x11 server: X.Org v: 1.21.1.7 with: Xwayland v: 22.1.9 driver: X: loaded: intel
    dri: i965 gpu: i915 display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.00x11.22") s-diag: 582mm (22.93")
  Monitor-1: DP-1 mapped: DP1 model: Lenovo C24-20 serial: <filter> built: 2021 res: 1920x1080
    hz: 60 dpi: 92 gamma: 1.2 size: 530x300mm (20.87x11.81") diag: 604mm (23.8") ratio: 16:9 modes:
    max: 1920x1080 min: 720x400
  API: OpenGL v: N/A renderer: N/A direct-render: N/A
Audio:
  Device-1: Intel Cannon Lake PCH cAVS vendor: Hewlett-Packard driver: snd_hda_intel
    bus-ID: 1-2.3:42 v: kernel chip-ID: 1224:2a25 alternate: snd_soc_skl,snd_sof_pci_intel_cnl
    class-ID: 0102 bus-ID: 00:1f.3 chip-ID: 8086:a348 class-ID: 0403
  Device-2: Jieli USB PHY 2.0 type: USB driver: snd-usb-audio,uvcvideo
  API: ALSA v: k6.1.0-33-amd64 status: kernel-api tools: alsamixer,amixer
  Server-1: PipeWire v: 1.0.0 status: active with: 1: pipewire-pulse status: active
    2: wireplumber status: off 3: pipewire-alsa type: plugin 4: pw-jack type: plugin
    tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Hewlett-Packard
    driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1 port: 3000 bus-ID: 02:00.0
    chip-ID: 10ec:8168 class-ID: 0200
  IF: eth0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  Device-2: Realtek RTL8192EU 802.11b/g/n WLAN Adapter type: USB driver: rtl8xxxu bus-ID: 1-8:3
    chip-ID: 0bda:818b class-ID: 0000 serial: <filter>
  IF: wlan0 state: up mac: <filter>
Drives:
  Local Storage: total: 238.47 GiB used: 25.81 GiB (10.8%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung model: MZVLB256HAHQ-000H7 size: 238.47 GiB
    block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter>
    rev: EXD70H2Q temp: 48.9 C scheme: GPT
Partition:
  ID-1: / raw-size: 40 GiB size: 39.08 GiB (97.69%) used: 9.31 GiB (23.8%) fs: ext4
    dev: /dev/nvme0n1p5 maj-min: 259:2
  ID-2: /home raw-size: 40 GiB size: 39.08 GiB (97.69%) used: 16.5 GiB (42.2%) fs: ext4
    dev: /dev/nvme0n1p6 maj-min: 259:3
Swap:
  Kernel: swappiness: 15 (default 60) cache-pressure: 50 (default 100)
  ID-1: swap-1 type: partition size: 10 GiB used: 0 KiB (0.0%) priority: -2 dev: /dev/nvme0n1p7
    maj-min: 259:4
Sensors:
  System Temperatures: cpu: 43.0 C pch: 52.0 C mobo: N/A
  Fan Speeds (RPM): N/A
Repos:
  Packages: pm: dpkg pkgs: 2506 libs: 1201 tools: apt,apt-get,aptitude,gnome-software,nala,synaptic
    pm: rpm pkgs: 0 pm: flatpak pkgs: 0
  No active apt repos in: /etc/apt/sources.list
  Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list
    1: deb http://deb.debian.org/debian/ bookworm-updates main contrib non-free non-free-firmware
  Active apt repos in: /etc/apt/sources.list.d/debian.list
    1: deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
    2: deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
  Active apt repos in: /etc/apt/sources.list.d/mx.list
    1: deb http://nl.mxrepo.com/mx/repo/ bookworm main non-free
  Active apt repos in: /etc/apt/sources.list.d/protonvpn-stable.sources
    1: deb https://repo.protonvpn.com/debian stable main
Info:
  Processes: 263 Uptime: 7d 1h 38m wakeups: 1 Memory: 7.6 GiB used: 2.27 GiB (29.9%) Init: SysVinit
  v: 3.06 runlevel: 5 default: graphical tool: systemctl Compilers: gcc: 12.2.0 alt: 12
  Client: shell wrapper v: 5.2.15-release inxi: 3.3.26
Boot Mode: UEFI
Old RSTS hack
Registered Linux user #542196

Stuart_M
Posts: 690
Joined: Wed Aug 07, 2019 7:10 pm

Re: Help on purging flatpak  [Solved]

#2 Post by Stuart_M »

First, I agree 100% with your reasons.

This is how I completely removed all flatpak related files, with the exception of some flatpak icons - I should probably remove those too just to be complete...

Anyway, this is how I did it. I use MX-19.4 Xfce (it was also done in MX-21.3 Xfce):

1. I ran sudo apt purge flatpak which removes the flatpak package, the same as uninstalling it with MXPI.
2. I then ran sudo apt autoremove whch removed the following packages which were left over from uninstalling the flatpak package in MX-19.4:
  • libappstream-glib8
  • libostree-1-1
  • libstemmer0d
  • libyaml-0-2
3. I then ran sudo rm -rv /var/lib/flatpak/ ; rm -rv ~/.local/share/flatpak/ to remove those two packages.
4. I then ran rm -rv ~/.cache/flatpak/ ; ~/.cache/.flatpak-cache to remove those two packages, the latter is a symlink.
5. I then ran sudo rm -rv /var/tmp/flatpak-cache-* to delete the flatpak cache files in /var/temp/ which are the majority of the files. At this point mostly (only?) flatpak icon files remain.

6. This command will (should) locate any file that has flatpak in the file name, excluding all files in the /usr/share/icons/* directory. I run this command to ensure "I got them all":

Code: Select all

sudo find / -iname '*flatpak*' -not -path */usr/share/icons/* -print0 | xargs -0 du -hc | sort -n


If you feel confident you can run the below command to delete all flatpak related files in one fell swoop. The -i in the remove command is to prompt before removal. I suppose if you really feel confident then get rid of that, maybe add -v to get a visual output of what is happening and "let her rip".

Code: Select all

sudo find / -iname '*flatpak*' -exec rm -ir {} \;




Oh and, by the way, I also removed any flatpak files in root (switch to root with su) which, without having had any flatpaks installed, was 418+ MiB and in an evaluation MX-21 Xfce installation it was 600+ MiB, both in the root account which I almost never access!

User avatar
MikeR
Posts: 195
Joined: Sun Jun 25, 2023 6:42 am

Re: Help on purging flatpak

#3 Post by MikeR »

@Stuart_M Thanks for your reply

After running all the previous commands verbatim I tried

Code: Select all

sudo find / -iname '*flatpak*' -not -path */usr/share/icons/* -print0 | xargs -0 du -hc | sort -n 
find: ‘/run/user/1000/doc’: Permission denied
find: ‘/run/user/1000/gvfs’: Permission denied
du: cannot access '/var/lib/polkit-1/localauthority/10-vendor.d/org.freedesktop.Flatpak.pkla': Permission denied
du: cannot access '/root/.local/share/flatpak': Permission denied
du: cannot access '/usr/share/polkit-1/rules.d/org.freedesktop.Flatpak.rules': Permission denied
1.1M	/usr/libexec/flatpak-portal
1.4M	/usr/bin/flatpak
4.0K	/etc/profile.d/flatpak.sh
4.0K	/etc/X11/Xsession.d/20flatpak
4.0K	/home/mike/.local/share/flatpak/db
4.0K	/usr/lib/systemd/system-environment-generators/60-flatpak-system-only
4.0K	/usr/lib/systemd/system/flatpak-system-helper.service
4.0K	/usr/lib/systemd/user-environment-generators/60-flatpak
4.0K	/usr/lib/systemd/user/flatpak-oci-authenticator.service
4.0K	/usr/lib/systemd/user/flatpak-portal.service
4.0K	/usr/lib/systemd/user/flatpak-session-helper.service
4.0K	/usr/lib/sysusers.d/flatpak.conf
4.0K	/usr/lib/tmpfiles.d/flatpak.conf
4.0K	/usr/share/bash-completion/completions/flatpak
4.0K	/usr/share/dbus-1/services/org.flatpak.Authenticator.Oci.service
4.0K	/usr/share/dbus-1/services/org.freedesktop.Flatpak.service
4.0K	/usr/share/dbus-1/services/org.freedesktop.portal.Flatpak.service
4.0K	/usr/share/dbus-1/system.d/org.freedesktop.Flatpak.SystemHelper.conf
4.0K	/usr/share/dbus-1/system-services/org.freedesktop.Flatpak.SystemHelper.service
4.0K	/usr/share/doc-base/flatpak.flatpak-commands
4.0K	/usr/share/doc/bubblewrap/examples/flatpak.bpf
4.0K	/usr/share/doc/bubblewrap/examples/flatpak-run.sh
4.0K	/usr/share/fish/vendor_completions.d/flatpak.fish
4.0K	/usr/share/fish/vendor_conf.d/flatpak.fish
4.0K	/usr/share/help/C/evolution/flatpak-limitations.page
4.0K	/usr/share/lintian/overrides/flatpak
4.0K	/usr/share/mime/application/vnd.flatpak.ref.xml
4.0K	/usr/share/mime/application/vnd.flatpak.repo.xml
4.0K	/usr/share/mime/application/vnd.flatpak.xml
4.0K	/usr/share/zsh/vendor-completions/_flatpak
4.0K	/var/lib/swcatalog/icons/debian-bookworm-main/48x48/plasma-discover-backend-flatpak_system-software-install.png
4.0K	/var/lib/swcatalog/icons/debian-bookworm-main/64x64/plasma-discover-backend-flatpak_system-software-install.png
4.7M	total
8.0K	/home/mike/.local/share/flatpak
8.0K	/usr/share/applications/gnome-software-local-file-flatpak.desktop
12K	/usr/share/bug/flatpak
16K	/usr/libexec/flatpak-validate-icon
16K	/usr/share/flatpak/triggers
20K	/usr/share/flatpak
64K	/usr/share/polkit-1/actions/org.freedesktop.Flatpak.policy
156K	/usr/libexec/flatpak-session-helper
960K	/usr/libexec/flatpak-oci-authenticator
980K	/usr/libexec/flatpak-system-helper
In desperation I tried (by the way I have a fairly up-to-date full backup...):

Code: Select all

sudo find / -iname '*flatpak*' -exec rm -ir {} \;
rm: remove regular file '/var/lib/swcatalog/icons/debian-bookworm-main/64x64/plasma-discover-backend-flatpak_system-software-install.png'? y
rm: remove regular file '/var/lib/swcatalog/icons/debian-bookworm-main/48x48/plasma-discover-backend-flatpak_system-software-install.png'? y
rm: remove regular file '/var/lib/polkit-1/localauthority/10-vendor.d/org.freedesktop.Flatpak.pkla'? y
rm: remove regular file '/etc/profile.d/flatpak.sh'? y
rm: remove regular file '/etc/X11/Xsession.d/20flatpak'? y
find: ‘/run/user/1000/doc’: Permission denied
find: ‘/run/user/1000/gvfs’: Permission denied
rm: descend into directory '/root/.local/share/flatpak'? y
rm: remove directory '/root/.local/share/flatpak/db'? y
rm: remove regular empty file '/root/.local/share/flatpak/.changed'? y
rm: descend into directory '/root/.local/share/flatpak/repo'? y
rm: remove directory '/root/.local/share/flatpak/repo/extensions'? y
rm: descend into directory '/root/.local/share/flatpak/repo/refs'? y
rm: remove directory '/root/.local/share/flatpak/repo/refs/heads'? y
rm: remove directory '/root/.local/share/flatpak/repo/refs/mirrors'? y
rm: remove directory '/root/.local/share/flatpak/repo/refs/remotes'? y
rm: remove directory '/root/.local/share/flatpak/repo/refs'? y
rm: remove regular file '/root/.local/share/flatpak/repo/config'? y
rm: descend into directory '/root/.local/share/flatpak/repo/tmp'? y
rm: remove directory '/root/.local/share/flatpak/repo/tmp/cache'? y
rm: remove directory '/root/.local/share/flatpak/repo/tmp'? y
rm: remove directory '/root/.local/share/flatpak/repo/state'? y
rm: remove directory '/root/.local/share/flatpak/repo/objects'? y
rm: remove directory '/root/.local/share/flatpak/repo'? y
rm: remove directory '/root/.local/share/flatpak'? y
find: ‘/root/.local/share/flatpak’: No such file or directory
rm: remove regular file '/usr/share/doc-base/flatpak.flatpak-commands'? y
rm: remove regular file '/usr/share/lintian/overrides/flatpak'? y
rm: remove regular file '/usr/share/applications/gnome-software-local-file-flatpak.desktop'? y
rm: remove regular file '/usr/share/fish/vendor_conf.d/flatpak.fish'? y
rm: remove regular file '/usr/share/fish/vendor_completions.d/flatpak.fish'? y
rm: descend into directory '/usr/share/flatpak'? y
rm: descend into directory '/usr/share/flatpak/triggers'? y
rm: remove regular file '/usr/share/flatpak/triggers/gtk-icon-cache.trigger'? y
rm: remove regular file '/usr/share/flatpak/triggers/mime-database.trigger'? y
rm: remove regular file '/usr/share/flatpak/triggers/desktop-database.trigger'? y
rm: remove directory '/usr/share/flatpak/triggers'? y
rm: remove directory '/usr/share/flatpak'? y
find: ‘/usr/share/flatpak’: No such file or directory
rm: remove regular file '/usr/share/zsh/vendor-completions/_flatpak'? y
rm: remove regular file '/usr/share/icons/Papirus/22x22/mimetypes/application-vnd.flatpak.svg'? y
rm: remove symbolic link '/usr/share/icons/Papirus/22x22/mimetypes/application-vnd.flatpak.ref.svg'? y
rm: remove symbolic link '/usr/share/icons/Papirus/22x22/mimetypes/application-vnd.flatpak.repo.svg'? y
rm: remove symbolic link '/usr/share/icons/Papirus/22x22/apps/org.flatpak.qtdemo.svg'? y
rm: remove regular file '/usr/share/icons/Papirus/24x24/mimetypes/application-vnd.flatpak.svg'? y
rm: remove symbolic link '/usr/share/icons/Papirus/24x24/mimetypes/application-vnd.flatpak.ref.svg'? y
rm: remove symbolic link '/usr/share/icons/Papirus/24x24/mimetypes/application-vnd.flatpak.repo.svg'? y
rm: remove symbolic link '/usr/share/icons/Papirus/24x24/apps/org.flatpak.qtdemo.svg'? y
rm: remove regular file '/usr/share/icons/Papirus/64x64/mimetypes/application-vnd.flatpak.svg'? y
rm: remove symbolic link '/usr/share/icons/Papirus/64x64/mimetypes/application-vnd.flatpak.ref.svg'? y
rm: remove symbolic link '/usr/share/icons/Papirus/64x64/mimetypes/application-vnd.flatpak.repo.svg'? y
rm: remove symbolic link '/usr/share/icons/Papirus/64x64/apps/org.flatpak.qtdemo.svg'? y
rm: remove regular file '/usr/share/icons/Papirus/48x48/mimetypes/application-vnd.flatpak.svg'? y
rm: remove symbolic link '/usr/share/icons/Papirus/48x48/mimetypes/application-vnd.flatpak.ref.svg'? y
rm: remove symbolic link '/usr/share/icons/Papirus/48x48/mimetypes/application-vnd.flatpak.repo.svg'? y
rm: remove symbolic link '/usr/share/icons/Papirus/48x48/apps/org.flatpak.qtdemo.svg'? y
rm: remove regular file '/usr/share/icons/Papirus/16x16/mimetypes/application-vnd.flatpak.svg'? y
rm: remove symbolic link '/usr/share/icons/Papirus/16x16/mimetypes/application-vnd.flatpak.ref.svg'? y
rm: remove symbolic link '/usr/share/icons/Papirus/16x16/mimetypes/application-vnd.flatpak.repo.svg'? y
rm: remove symbolic link '/usr/share/icons/Papirus/16x16/apps/org.flatpak.qtdemo.svg'? y
rm: remove regular file '/usr/share/icons/Papirus/32x32/mimetypes/application-vnd.flatpak.svg'? y
rm: remove symbolic link '/usr/share/icons/Papirus/32x32/mimetypes/application-vnd.flatpak.ref.svg'? y
rm: remove symbolic link '/usr/share/icons/Papirus/32x32/mimetypes/application-vnd.flatpak.repo.svg'? y
rm: remove symbolic link '/usr/share/icons/Papirus/32x32/apps/org.flatpak.qtdemo.svg'? y
rm: descend into directory '/usr/share/bug/flatpak'? y
rm: remove regular file '/usr/share/bug/flatpak/script'? y
rm: remove regular file '/usr/share/bug/flatpak/control'? y
rm: remove directory '/usr/share/bug/flatpak'? y
find: ‘/usr/share/bug/flatpak’: No such file or directory
rm: remove regular file '/usr/share/bash-completion/completions/flatpak'? y
rm: remove regular file '/usr/share/help/C/evolution/flatpak-limitations.page'? y
rm: remove regular file '/usr/share/mime/application/vnd.flatpak.ref.xml'? y
rm: remove regular file '/usr/share/mime/application/vnd.flatpak.xml'? y
rm: remove regular file '/usr/share/mime/application/vnd.flatpak.repo.xml'? y
rm: remove regular file '/usr/share/dbus-1/system-services/org.freedesktop.Flatpak.SystemHelper.service'? y
rm: remove regular file '/usr/share/dbus-1/services/org.freedesktop.Flatpak.service'? y
rm: remove regular file '/usr/share/dbus-1/services/org.flatpak.Authenticator.Oci.service'? y
rm: remove regular file '/usr/share/dbus-1/services/org.freedesktop.portal.Flatpak.service'? y
rm: remove regular file '/usr/share/dbus-1/system.d/org.freedesktop.Flatpak.SystemHelper.conf'? y
rm: remove regular file '/usr/share/polkit-1/actions/org.freedesktop.Flatpak.policy'? y
rm: remove regular file '/usr/share/polkit-1/rules.d/org.freedesktop.Flatpak.rules'? y
rm: remove regular file '/usr/share/doc/bubblewrap/examples/flatpak.bpf'? y
rm: remove regular file '/usr/share/doc/bubblewrap/examples/flatpak-run.sh'? y
rm: remove regular file '/usr/lib/sysusers.d/flatpak.conf'? y
rm: remove regular file '/usr/lib/tmpfiles.d/flatpak.conf'? y
rm: remove regular file '/usr/lib/systemd/system/flatpak-system-helper.service'? y
rm: remove regular file '/usr/lib/systemd/system-environment-generators/60-flatpak-system-only'? y
rm: remove regular file '/usr/lib/systemd/user-environment-generators/60-flatpak'? y
rm: remove regular file '/usr/lib/systemd/user/flatpak-portal.service'? y
rm: remove regular file '/usr/lib/systemd/user/flatpak-oci-authenticator.service'? y
rm: remove regular file '/usr/lib/systemd/user/flatpak-session-helper.service'? y
rm: remove regular file '/usr/libexec/flatpak-validate-icon'? y
rm: remove regular file '/usr/libexec/flatpak-session-helper'? y
rm: remove regular file '/usr/libexec/flatpak-portal'? y
rm: remove regular file '/usr/libexec/flatpak-oci-authenticator'? y
rm: remove regular file '/usr/libexec/flatpak-system-helper'? y
rm: remove regular file '/usr/bin/flatpak'? y
rm: descend into directory '/home/mike/.local/share/flatpak'? y
rm: remove directory '/home/mike/.local/share/flatpak/db'? y
rm: remove directory '/home/mike/.local/share/flatpak'? y
find: ‘/home/mike/.local/share/flatpak’: No such file or directory
root@mxprodesk:/home/mike# 
which required me to enter 'y' for every line...

even after all that, still saw:

Code: Select all

sudo apt full-upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
  flatpak libostree-1-1
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,721 kB of archives.
After this operation, 8,455 kB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.
Still hanging on to hope...
Mike
Old RSTS hack
Registered Linux user #542196

User avatar
MikeR
Posts: 195
Joined: Sun Jun 25, 2023 6:42 am

Re: Help on purging flatpak

#4 Post by MikeR »

HOORAY! GOOGLE was my friend!!
@Stuart_M Perhaps add this to your list. Thanks for starting me in the correct direction.

https://askubuntu.com/questions/75895/h ... -installed

Code: Select all

sudo nano /etc/apt/preferences

cat /etc/apt/preferences
Package: flatpak 
Pin: release *
Pin-Priority: -1
and now:

Code: Select all

$ sudo apt full-upgrade
[sudo] password for mike:             
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Old RSTS hack
Registered Linux user #542196

Stuart_M
Posts: 690
Joined: Wed Aug 07, 2019 7:10 pm

Re: Help on purging flatpak

#5 Post by Stuart_M »

As can be seen in the second bullet-point in Step 2 of my Post #2 above, I had removed (autoremoved) the "libostree-1-1" package (it was an orphan package left over after the flatpak package was removed). Remember this is MX-19 and also, if memory serves, MX-21.

In your case, for some reason the libostree-1-1 and flatpak packages continued to try and be installed again, even after removing essentially everything related to the flatpak package.

I know you used /etc/apt/preferences which works. Personally I would have just used sudo apt-mark hold flatpak to keep it from being installed and then see if the libostree-1-1 package wants to be installed.

According to the results in your Post #4 I would suspect that the "libostree-1-1" package would no longer try to be installed. But if so then I would run sudo apt-mark hold libostree-1-1 to keep it from being installed.



All said I don't really consider that a fix but more of a workaround since the root cause of those two packages wanting to be installed remains and, at least for me personally, that would irk me to no end.

My initial thought is that something relating to flatpak is included in the apt source, especially since they try to be installed only after updating from your apt sources, or so it seems. That would make me look at the MX Repo Manager "Individual sources" tab and see if something flatpak related is listed, and if so, I would not just disable it, I would delete it. I would also check the "Debian repos" tab just in case.

Just my thoughts. Glad it worked. You are a brave soul!

Stuart_M
Posts: 690
Joined: Wed Aug 07, 2019 7:10 pm

Re: Help on purging flatpak

#6 Post by Stuart_M »

This is just an after-thought curiosity. Did you check for any flatpak files in /root/? Like I said in my Post #2, I found over 400 MiB of flatpak junk in MX-19 /root and that was without ever having accessed or installed any flatpak packages.

One way to check is with the command in the below code window. If you want you can change -bc to -kc or -mc to list the size in KiB or MiB (vice bytes) if the files are large:

Code: Select all

sudo find /root -iname '*flatpak*' -print0 | xargs -0 sudo du -bc

You can open a root instance of Thunar (right-click Thunar and select "Open root Thunar here") if you like.

User avatar
asqwerth
Developer
Posts: 7749
Joined: Sun May 27, 2007 5:37 am

Re: Help on purging flatpak

#7 Post by asqwerth »

flatpak apps aren't found in any normal style repos so won't be in the apt source.

THe flatpak framework -- and whatever packages make this up - are preinstalled in MX, but unless you click on the MXPI flatpak tab at all, and enter your password when asked that first time clicking on the tab, NO flatpak repo [called "remotes"] are enabled on your system. And the only remote that will be installed when you first click on that tab (if you grant it permission by entering your password in the authorisation window) is the flathub remote.

So unless you had previously tried clicking on that tab and installed a flatpak app at some point, you should not have flatpak apps or ciorresponding runtimes installed on your system.

And running sudo apt update will not refresh or check any flatpak remote ever.
Desktop: Intel i5-4460, 16GB RAM, Intel integrated graphics
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400

Stuart_M
Posts: 690
Joined: Wed Aug 07, 2019 7:10 pm

Re: Help on purging flatpak

#8 Post by Stuart_M »

That's good information. I did at some point in years past, click on the flatpak tab "just to see", and I remember installing a flatpak out of curosity which was then immediately removed. Would that have anything to do with a 400+ MiB flatpak presence in /root?

However the question remains; why did the two libostree-1-1 and flatpak packages continue to try to be installed in @MikeR's system after the prior removal of anything "flatpak" related?

I think the primary flatpak package trying to be installed after it was uninstalled is a big clue.

User avatar
MikeR
Posts: 195
Joined: Sun Jun 25, 2023 6:42 am

Re: Help on purging flatpak

#9 Post by MikeR »

@asqwerth
I have never, ever, in several decades of running Linux used or installed any flatpak or appimage.
Before coming to MX I used Ubuntu, tried several workarounds to avoid snap, and finally began using
MX -- No systemD and therefor no snap. (another reason was mx-snapshot, once remastersys died.)
On a relatively vanilla MX install there were, however, several *hundred* flatpak-related files, for
which I had no use. Therefor this topic.

Mike

N.B. you wrote
And running sudo apt update will not refresh or check any flatpak remote ever.
But it will update parts of the flatpak ecosystem itself.
Old RSTS hack
Registered Linux user #542196

User avatar
asqwerth
Developer
Posts: 7749
Joined: Sun May 27, 2007 5:37 am

Re: Help on purging flatpak

#10 Post by asqwerth »

Stuart_M wrote: Wed Apr 23, 2025 8:44 am That's good information. I did at some point in years past, click on the flatpak tab "just to see", and I remember installing a flatpak out of curosity which was then immediately removed. Would that have anything to do with a 400+ MiB flatpak presence in /root?
if you installed a flatpak app per user instead of system-wide (ie, without sudo, ) I think all the apps and runtimes will be in $HOME/.var. If installed systemwide, perhaps that's where the flatpak app is installed? I don't think it's the runtime, because those can be close to 1GB in size (which is why there is a button in the flatpak tab of MXPI to remove unused remotes).
However the question remains; why did the two libostree-1-1 and flatpak packages continue to try to be installed in @MikeR's system after the prior removal of anything "flatpak" related?

I think the primary flatpak package trying to be installed after it was uninstalled is a big clue.
It might be that these 2 packages, which I think are part of the flatpak framework - might be dependencies of MXPI [for the purposes of the flatpak tab]. However, I can't be sure, because I thought at one stage, because of other users' requests, @Adrian had removed that dependency.

Let's wait for him to reply.

@MikeR
On MX19, I used the Lollypop music player flatpak, because MX19's Debian base was too old to have Lollypop.

Now, I still only have 1 flatpak app, which is oomox, though I hardly use it now, because the themes generated don't include gtk4 theming. But I recall trying the oomox that the packaging team built for MX21, and it just didn't work as well as the flatpak version, which is why I've stuck with the flatpak version.

I think flatpak is useful for situations where the actual debian-style package can't be built for the Debian base. Apart from that, where possible of course native packages are better and smaller.
Desktop: Intel i5-4460, 16GB RAM, Intel integrated graphics
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400

Post Reply

Return to “MX Help”