pop-os / pop

A project for managing all Pop!_OS sources
https://system76.com/pop
2.47k stars 87 forks source link

POP OS Does Not Appear to Respect Flatpak Masking Which Keeps Back Problem Flatpaks and Flatpak Upgrades to Specific Flatpak Apps #2273

Open ganakee opened 2 years ago

ganakee commented 2 years ago

Distribution (run cat /etc/os-release): NAME="Pop!_OS" VERSION="21.10" ID=pop ID_LIKE="ubuntu debian" PRETTY_NAME="Pop!_OS 21.10" VERSION_ID="21.10" HOME_URL="https://pop.system76.com" SUPPORT_URL="https://support.system76.com" BUG_REPORT_URL="https://github.com/pop-os/pop/issues" PRIVACY_POLICY_URL="https://system76.com/privacy" VERSION_CODENAME=impish UBUNTU_CODENAME=impish LOGO=distributor-logo-pop-os

Related Application and/or Package Version (run apt policy $PACKAGE NAME): flatpak --version Flatpak 1.11.2

Issue/Bug Description: Since Flatpak 1.5, Flatpak allows a user to issue a masking command to mask problem flatpaks or to avoid upgrading flatpaks. POP SHOP doesn't appear to recognize the masking and still posts the potential flatpak, updated item to Pop Shop.

Steps to reproduce (if you know): The user issues from terminal: flatpak mask org.gnome.Weather The user then opens Pop Shop (assuming an flatpak update for the target application exists). The update appears in POP SHOP.

Expected behavior: POP SHOP should either recognize the mask and not report the update or perhaps grey-out the update (or report that the application is masked, somehow).

Other Notes: Note: The user issues from terminal: flatpak mask --remove org.gnome.Weather to remove the masking.

keftie22 commented 2 years ago

Flatpak is set up in user mode by default in Pop OS.

You're actually gonna want to run:

flatpak mask --user org.gnome.Weather

ganakee commented 2 years ago

This fixes the "issue." Thank you @quinzee33

ganakee commented 2 years ago

N.B. As @quinzee33 correctly notes, the command to mask and have POP SHOP recognize the masking is: flatpak mask --user org.gnome.Weather

The order of operators appears important.

Thus, I mistakenly used on my laptop WRONG flatpak --user mask org.gnome.Weather (note Flatpak accepts this, but the masking does not appear to apply correctly.

To see if you successfully masked a Flatpak update, use just flatpak mask

This command then lists the masked items. Sample:

flatpak mask
Masked patterns:
  org.gnome.Weather

To see more information, reference the flatpak-mask man page.

ganakee commented 2 years ago

I revise this response and report that a problem may still exist with POP SHOP recognizing flatpak masking.

I performed the above masking using the correct user-space masking. On one POP OS System (same OS and same version level), POP SHOP respects the masking. This is System A and uses the Nvidia version of POP OS 21.10.

Another older laptop (System B) uses POP OS 21.10 but the non-NVidia version. In this version, POP SHOP, despite accurately and carefully using theflatpak mask --user org.gnome.Weather POP SHOP persistently shows GNOME Weather 42.0 (the new app at time of this potential bug report). This occurs after logging out, after multiple reboots, and after confirming via flatpak mask that the problem (for me) app is in fact masked. Yet, POP SHOP still consistently shows this as an update on System B.

The potential issue persists even after running POP SHOP update (manually selecting other components) and manually running apt update. flatpak update shows Nothing to do.

ganakee commented 2 years ago

I confirm that this is an issue but appears to be an issue with flatpak itself. I did quite a bit of research on this over the weekend. The issue appears to arise from flatpak's broken package management. The bug may be triggered byflatpak remove --unused

This command appears to place flatpak, regardless of prior masking, into a broken state and demands updates to masked items. After that command, flatpak itself seems to ignore the masking.

flatpak remove --unused

Now subsequent runnning of ``` flatpak update Looking for updates… Required runtime for org.gnome.Weather/x86_64/stable (runtime/org.gnome.Platform/x86_64/42) found in remote flathub Do you want to install it? [Y/n]:


This occurs even though the masking still seems intact.

flatpak mask --user Masked patterns: org.gnome.Weather

Masking for POP OS due to user installs.

sudo flatpak mask Masked patterns: org.gnome.Weather


Masking for other OSs as system masking.

This may be why POP SHOP persistently displays (in my case) Weather 42.0 because flatpak now reports an "update" even though masking is in place (and worked prior to flatpak remove --unused).

Just FYI.
Tested on two different installs. This may explain why one system worked as reported above and one did not. The bash history showed that I had run flatpak remove --unused on the laptop (System B) due to a much smaller SSD. Running the same on System A also broke the flatpak install/masking..
mmstick commented 2 years ago

For sure, the shop does not perform any package management itself. That is entirely up to the libflatpak library it's using.