linuxmint / mintupdate

The Linux Mint Update Manager
309 stars 152 forks source link

Too many flatpaks installed by default after upgrading from LM 21.0 to 21.1 #792

Open Redsandro opened 1 year ago

Redsandro commented 1 year ago

Describe the bug

Multiple users confirm huge amounts of data (gigabytes) are downloaded for flatpak updates, without consciously installing a single flatpak. It is unclear why these packages are installed. It is also not commonly known that this is (mostly) unnecessary. It is not communicated to the user what flatpak even is, and why these packages are installed by default. The (slow because download sizes) flatpak dialog is undescript and frustrating because of it.

It is not communicated to the user that the majority of these packages are not necessary, and it is not known why the pinned one (graphic driver in flatpak) is necessary.

Screenshots

image image

To Reproduce Steps to reproduce the behavior:

  1. Have 21.0 upgraded from 19.3
  2. Upgrade to 21.1
  3. See gigabytes of updates every [update interval]

Expected behavior

Distribution:

Software version: Update Manager 5.9.7

Additional context This happens when you have the nVidia video driver installed prior to upgrading, and choosing one of the offers (themes) by the welcome screen.

mtwebster commented 1 year ago

There are no flatpaks installed by default.

Purge (--unused) is currently run automatically by mintupdate only when automatic flatpak updates are enabled. I'll see about changing that so it always runs. This is likely why you have unused nvidia runtimes - when you update or change your nvidia driver, the next time you install or update any flatpaks, it will download the matching flatpak plugin for that particular driver version, just as it does for themes.

More than like the total actual download sizes are fairly small, as flatpaks share their contents when possible. Nvidia Flatpak A or B might be 100mb individually, but installing both may only require an additional few mb.

edit: This goes for updates too - updates are usually partial deltas of only what's changed. The misleading part is that flatpak (and, as a result, mintupdate/mintinstall) doesn't know exactly what the actual amount will be, only what it could be. This is why you'll see less-than signs for install/download sizes in the flatpak terminal command when installing something.

mtwebster commented 1 year ago

I've discovered some upstream issue as well - flatpak apparently isn't marking nvidia packages correctly so they'll get removed: https://github.com/flatpak/flatpak/issues/2718

It sounds somewhat deliberate.

Redsandro commented 1 year ago

Thanks for the explanation. I'd like to emphasize that we (n=3) observed that this set of packages is actually a quite big and slow download.

There are no flatpaks installed by default.

In that case, I think I may have gotten all these packages after choosing a theme from the "welcome screen", or a theme was installed from LM 21.0. I sincerely don't recall installing a bunch of flatpaks.

org.gtk.Gtk3theme.Mint-Y-Aqua/x86_64/3.22

alainpannetier commented 1 year ago

tl;dr: flatpak builds its parallel desktop environment in its own little parallel universe. To get rid of these, uninstall your flatpak apps and the supporting packages. Then uninstall flatpak. Then only will apt update be terser.

The flatpak packages that look related to the desktop are installed so that individual app flatpaks can execute on top of them. So if you just install, say VLC, as a flatpak, you'll get a parallel cinnamon in your flatpak, along with NVIDIA drivers, mesa, GL etc and including your theme. If you uninstall VLC, then remove the unused supporting packages, cinnamon will happily carry on working.

GitBobCat commented 1 year ago

I do not care. Just fix this rubbish you have imposed on me without me have to look under your bonnet to switch this crap off..

If Windscreen Wiper Left (24K) has security issues then fine but I don't need to download Whole Car Plus Boeing 787 and Cruise Liner along with 58 versions of Nvidea Graphics drivers at 348TB.

Mindustry FFS Screenshot from 2023-04-02 18-20-18

Lurux commented 1 year ago

Just a quick note for everyone:


@mtwebster, it seems like the issue you referenced was already fixed some time ago, and I can confirm old drivers get removed properly with flatpak remove --unused on my system.

I think the update manager should automatically run this command from time to time by default.

Another solution would be to ignore unused runtimes in the update manager. I don't know how this translates on your side, but on the command line you can run flatpak update --app, and this will only update apps and used runtimes, while ignoring unused runtimes.

mtwebster commented 1 year ago

@Lurux what you suggest is done: https://github.com/linuxmint/mintupdate/commit/9343575fabf0d32157ec849a5ca047af9812889d

(It should have been handling unused the entire time but instead was only doing so when auto-updating was also enabled)

I'll try and get an update out that includes this.

@GitBobCat Maybe check under your bonnet for some manners.

Lurux commented 1 year ago

Awesome ! It seems like the problem is solved then. Mint is really amazing.

GitBobCat commented 1 year ago

"@GitBobCat Maybe check under your bonnet for some manners."

Today, as it repeatedly does, my Engine Management System tells me I already have the buttplug flatpack wants to install.

Now it may not be your fault but don't call me for manners when your Car continues to ask me to install the buttplug I already have.

Screenshot from 2023-06-26 21-38-59

GitBobCat commented 1 year ago

Oh... and whilst, as a luser, I am having a moan.

Why has flatpak been given permission by the Egnine Management System to waste Download Fuel by installing ButtPlug 525, which I am already running, when the Driver Management System is recommending that I use ButtPlug 530?

Screenshot from 2023-06-27 19-52-21

Lurux commented 1 year ago

@GitBobCat, are you using a bad translation app, or are you intentionally being distasteful ?

Anyways, the driver Flatpak wants to update is the driver that's used by the sandboxed Flatpak apps, which needs to match the version installed on your system. I already looked into this, and there's no way to force them to use the system driver AFAIK.

If you really don't want to have a copy of your drivers installed, you could remove all your Flatpak drivers, then mask them using the following command: sudo flatpak mask org.freedesktop.Platform.GL*. This is useful on limited internet connections, but be aware that your Flatpak apps will no longer be hardware accelerated, and some of them may not work properly.

If you really want to complain, go harass the Flatpak developers. Or just keep your mouth shut for a minute, your comments here are a disgrace.

Ray-G-M commented 9 months ago

Hi, I'm running LM 21.2 and see the following updates offered: nvidia-525-105-17 org.freedesktop.Platform.GL.nvidia-525-105-17/1.4 nvidia-525-116-04 org.freedesktop.Platform.GL.nvidia-525-116-04/1.4 nvidia-525-125-06 org.freedesktop.Platform.GL.nvidia-525-125-06/1.4 nvidia-525-78-01 org.freedesktop.Platform.GL.nvidia-525-78-01/1.4 nvidia-525-89-02 org.freedesktop.Platform.GL.nvidia-525-89-02/1.4

I have also run flatpak uninstall --unused and nothing is removed and nothing changes. It advises that these runtimes are all pinned and will not be removed. I checked out the issue that mtwebster referred to as well as https://github.com/flatpak/flatpak/issues/5261. I have limited internet data and limited speed so this is an issue for me (more so than wasted space). I ran flatpak --gl-drivers and it reported: nvidia-525-125-06 default host

So I used flatpak uninstall -vv org.freedesktop.Platform.GL.nvidia-525-78-01/x86_64/1.4 F: No installations directory in /etc/flatpak/installations.d. Skipping F: Opening system flatpak installation at path /var/lib/flatpak F: Opening user flatpak installation at path /home/ray/.local/share/flatpak F: Transaction: uninstall flathub:runtime/org.freedesktop.Platform.GL.nvidia-525-78-01/x86_64/1.4[$old] F: marking op uninstall:runtime/org.freedesktop.Platform.GL.nvidia-525-78-01/x86_64/1.4 resolved to 57f8df31bf0f2a6a6b47d3bbd3562ddd61636bb523b727fffceb2c612572d021

  1. org.freedesktop.Platform.GL.nvidia-525-78-01 1.4 r

    Proceed with these changes to the system installation? [Y/n]: y Uninstalling… F: Calling system helper: Uninstall F: Calling system helper: PruneLocalRepo Uninstall complete.

And then similarly removed 525-89-02. (I thought the [$old] tag above was interesting on both.) I then reloaded the updates and only the remaining three were offered. I will be interested to see if the deletions make any difference, and if not I will try the other two.

Any thoughts or advice would be appreciated. Thanks

Ray-G-M commented 9 months ago

A thought occurred to me that might have an impact on my case. I gather that despite being sandboxed these Nvidia runtimes are connected with the kernels. My active kernel is 6.2.0-33, however I still have 5.15.0-84 installed. Being sandboxed, I would be surprised if flatpak is aware of that. Anyway at the next update offer I'll delete 5.15 and then see if that makes a difference.

Lurux commented 9 months ago

This seems weird - you didn't install those drivers manually, right ?

@mtwebster could this be a problem with your updater ?

Otherwise @Ray-G-M you'll probably want to fill an issue to the Flatpak developers.

Ray-G-M commented 9 months ago

Thanks Lurux, that is correct, they have been added through the updates. I have never added a flatpak driver manually.

I'm pretty ignorant about how all this works and links together, but if it is of any relevance, all of my flatpak apps have been there for a while and from memory I don't think the 525 series was around then. I'm pretty sure they have all been added via updates since.

Ray-G-M commented 9 months ago

Also, if it is any relevance, in common with the original poster, I too used the upgrade process from LM 19.3 rather than a fresh install.

Ray-G-M commented 9 months ago

Well the latest is really no surprise - I deleted the old kernels and no difference. (That is the other concern with all these Nvidia runtimes - they want to update very often.) Was offered to update the 3 remaining versions of the Nvidia 525 series, deleted the kernels, refreshed everything, ran:

flatpak uninstall --unused

These runtimes in installation 'system' are pinned and won't be removed; see flatpak-pin(1): runtime/org.freedesktop.Platform.GL.nvidia-525-105-17/x86_64/1.4 runtime/org.freedesktop.Platform.GL.nvidia-525-116-04/x86_64/1.4 runtime/org.freedesktop.Platform.GL.nvidia-525-125-06/x86_64/1.4 runtime/org.freedesktop.Platform.ffmpeg-full/x86_64/22.08 runtime/org.freedesktop.Platform.openh264/x86_64/2.2.0 runtime/org.gnome.Platform.Locale/x86_64/42 runtime/org.gtk.Gtk3theme.Mint-Y-Dark/x86_64/3.22 Nothing unused to uninstall

I haven't noticed any issues since recently deleting the other 525's, although I haven't used all of my 23(!) flatpaks yet. Whether any of their system runtimes would require a specific version of 525 runtime?? (I would rather not have any flatpaks, but it seems needs must!) If it is any use or relevance these are my runtimes:

flatpak list --runtime NameApplication ID____Version_Branch__Installation Freedesktop Platform__org.freedesktop.Platform___22.08.15_22.08 ___system Freedesktop Platform__org.freedesktop.Platform_23.08.1__23.08____system Mesa_____org.freedesktop.Platform.GL.default____21.3.921.08____system Mesa____org.freedesktop.Platform.GL.default____23.1.622.08____system Mesa (Extra) ____org.freedesktop.Platform.GL.default____23.1.6_22.08-extra__system Mesa_____org.freedesktop.Platform.GL.default____23.1.723.08____system Mesa (Extra)____org.freedesktop.Platform.GL.default____23.1.723.08-extra_system nvidia-525-105-17___org.freedesktop.Platform.GL.nvidia-525-105-17__1.4__system nvidia-525-116-04org.freedesktop.Platform.GL.nvidia-525-116-04__1.4__system nvidia-525-125-06org.freedesktop.Platform.GL.nvidia-525-125-06_1.4__system Intel____org.freedesktop.Platform.VAAPI.Intel____21.08____system Inte____org.freedesktop.Platform.VAAPI.Intel_____22.08____system Intel____org.freedesktop.Platform.VAAPI.Intel____23.08____system ffmpeg-fullorg.freedesktop.Platform.ffmpeg-full____22.08____system ffmpeg-fullorg.freedesktop.Platform.ffmpeg-full____23.08____system openh264__org.freedesktop.Platform.openh264_2.1.0___2.0__system openh264__org.freedesktop.Platform.openh2642.1.0_2.2.0___system GIMP User Manual_org.gimp.GIMP.Manual___2.10_____2.10__system GNOME Application Platform version 44org.gnome.Platform____44____system GNOME Application Platform version 45org.gnome.Platform____45____system gnome platform translations org.gnome.Platform.Locale____42____system Mint-Y Gtk Theme__org.gtk.Gtk3theme.Mint-Y____3.22__system Mint-Y-Aqua Gtk Theme _org.gtk.Gtk3theme.Mint-Y-Aqua__3.22__system Mint-Y-Dark Gtk Themeorg.gtk.Gtk3theme.Mint-Y-Dark__3.22__system KDE Application Platformorg.kde.Platform____5.15-21.08system KDE Application Platformorg.kde.Platform____5.15-22.08system Telegram Desktop Webview Add-onorg.telegram.desktop.webview__2.42.1__stable____system

(A user manual and an add-on as runtimes?) (And a shame this blog strips out the spacing - is the only other option to insert a graphic?) Thanks again.

Lurux commented 9 months ago

@Ray-G-M, you should use flatpak pin to list all your pinned runtimes, then sudo flatpak pin --remove <runtime> all your drivers (as well as anything that seems odd) to unmark them as force-installed.

Then you can safely use flatpak uninstall --unused and it will automatically delete unused drivers and runtimes.

As a rule of thumb, your flatpak pin should generally be empty (or only contain themes), and you only need to have the flatpak driver matching your system driver to be installed.

Hope this helps !

GitBobCat commented 9 months ago

With the caveat that I am an idiot who does not speak English and also is incapable of following instructions at any meaningful level of understanding them or remembering what I di and what happened and whether it may or may not have been relevent. I did all or most of the suggestions and nothing happen and then I took to randomly nuking things and finally... what seemed to do it.

1) Do the other stuff. 2) Nuke anything you have recently installed. 3) Blacklist the evil in Update Manager.

Screenshot from 2023-09-29 09-23-37

My only consequence was or appeared to be that the Software Manager went on holiday. Now there is a fix for that but I found it via the usual 169 visits to failed forum threads and can't remember what it was but.... the solution involved a method that resulted in Flatpack getting involved again.

ARGHHH!

Anyway even though it seemed to be needed in that case the incesscent 14TB downloads of Nvidia still seem to have stopped. Best guess is therefore Blacklist them.

Redsandro commented 9 months ago

use flatpak pin to list all your pinned runtimes, then sudo flatpak pin --remove <runtime> all your drivers (as well as anything that seems odd) to unmark them as force-installed.

Then you can safely use flatpak uninstall --unused and it will automatically delete unused drivers and runtimes.

As a rule of thumb, your flatpak pin should generally be empty (or only contain themes), and you only need to have the flatpak driver matching your system driver to be installed.

Thank you. This is helpful. I switch video driver versions sometimes when a certain new kernel/driver combo doesn't like my specific hardware. I noticed that flatpak doesn't uninstall the driver versions I uninstalled from the system. Perhaps this will be fixed in @mtwebster's https://github.com/linuxmint/mintupdate/commit/9343575fabf0d32157ec849a5ca047af9812889d if it is not included in current updates yet, because at the moment unused video drivers versions stay pinned:

$ flatpak pin
Pinned patterns:
  runtime/org.freedesktop.Platform.GL.nvidia-470-199-02/x86_64/1.4
  runtime/org.freedesktop.Platform.GL.nvidia-515-86-01/x86_64/1.4
  runtime/org.freedesktop.Platform.GL.nvidia-525-125-06/x86_64/1.4
  runtime/org.gtk.Gtk3theme.Mint-Y-Aqua/x86_64/3.22
Ray-G-M commented 9 months ago

Yes, thank you @Lurux, this is indeed very helpful. When I ran flatpak pin the list included the old Nvidia runtimes I had removed previously, plus some other types not yet seen. I unpinned all except the theme 2 and ran flatpak uninstall --unused and the 2 old remaining Nvidia drivers were removed plus 2 of the other 4 now unpinned runtimes. And of course flatpak list --runtime now shows 4 fewer in total. I then re-ran the updater and it only offered an update for the 1 current Nvidia driver.

I am still puzzled as to why I had any of these pinned. Your assistance is much appreciated, and I consider my issue closed. However, I will keep an eye on it should I be offered duplicate drivers in future. And I notice that the commit by @mtwebster only seems to be addressing un-pinned runtimes.

All the best.

Ray-G-M commented 9 months ago

An interesting development today. The updater offered updates to org.freedesktop.Platform so I first ran flatpak update and it informed me that _org.freedesktop.Platform.VAAPI.Intel/x8664/21.08 and _org.freedesktop.Platform.GL.default/x8664/21.08 were both "no longer receiving fixes and security updates. Please update to a supported runtime version". I then ran the updater and surprisingly instead of updating them it removed them, and when the screen refreshed it then offered to install them. I did this and now I find that both these runtimes are pinned and supposedly unsupported. (In all this the updater identifies these runtimes differently to the CLI; it has the GL version as 21.3.9 and the VAAPI has a long string of characters, and the latter changed with the reinstall whereas the former did not.)

Lurux commented 9 months ago

You should open a new issue for this or search id there's already one.