Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flatpak should allow custom --user install locations #4403

Open
Mark-Booth opened this issue Sep 8, 2021 · 4 comments
Open

Flatpak should allow custom --user install locations #4403

Mark-Booth opened this issue Sep 8, 2021 · 4 comments

Comments

@Mark-Booth
Copy link

Mark-Booth commented Sep 8, 2021

Environment

Flatpak v1.0.9 on RHEL 7.9 (Maipo), but issue is distribution independent, and according to the documentation is extant in the most recent version of flatpak.

Description

Trying to install a flatpak application with the --user option, it failed due to my home directory being pushed over quota by the files downloaded to ~/.local/share/flatpak:

$rm -rf ~/.local/share/flatpak/*
$flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
$flatpak install --user com.github.debauchee.barrier.flatpakref
Required runtime for com.github.debauchee.barrier/x86_64/stable (runtime/org.kde.Platform/x86_64/5.15) found in remote flathub
Do you want to install it? [y/n]: y
Installing in user:
org.kde.Platform/x86_64/5.15                            flathub 4820a00d9526
org.freedesktop.Platform.GL.default/x86_64/20.08        flathub 3fbdbccc95ab
org.freedesktop.Platform.GL.nvidia-460-73-01/x86_64/1.4 flathub b44739fde59e
org.freedesktop.Platform.openh264/x86_64/2.0            flathub 73f998362a6f
org.kde.KStyle.Adwaita/x86_64/5.15                      flathub 02860ce9758a
org.kde.Platform.Locale/x86_64/5.15                     flathub 778abe2eca6e
com.github.debauchee.barrier/x86_64/stable              flathub 786ba72aa052
  permissions: ipc, network, x11, dri
  file access: xdg-config/kdeglobals:ro
  dbus access: com.canonical.AppMenu.Registrar, org.a11y.*, org.kde.StatusNotifierWatcher
  dbus ownership: org.kde.*
  system dbus access: org.freedesktop.Avahi
com.github.debauchee.barrier.Locale/x86_64/stable       flathub c2464d8afe80
Is this ok [y/n]: y
Installing for user: org.kde.Platform/x86_64/5.15 from flathub
[####################] 1135 metadata, 26291 content objects fetched; 345631 KiB transferred in 649 seconds
Now at 4820a00d9526.
Installing for user: org.freedesktop.Platform.GL.default/x86_64/20.08 from flathub
[#################   ] Downloading files: 84/95 105.3 MB (15.0 MB/s)            
Warning: Failed to install org.freedesktop.Platform.GL.default/x86_64/20.08: While pulling runtime/org.freedesktop.Platform.GL.default/x86_64/20.08 from remote flathub: Writing content object: Disk quota exceeded
Installing for user: org.freedesktop.Platform.GL.nvidia-460-73-01/x86_64/1.4 from flathub
Warning: Failed to install org.freedesktop.Platform.GL.nvidia-460-73-01/x86_64/1.4: While pulling runtime/org.freedesktop.Platform.GL.nvidia-460-73-01/x86_64/1.4 from remote flathub: Unable to write detached metadata: fdatasync: Disk quota exceeded
Installing for user: org.freedesktop.Platform.openh264/x86_64/2.0 from flathub
Warning: Failed to install org.freedesktop.Platform.openh264/x86_64/2.0: Disk quota exceeded
Installing for user: org.kde.KStyle.Adwaita/x86_64/5.15 from flathub
Warning: Failed to install org.kde.KStyle.Adwaita/x86_64/5.15: Disk quota exceeded
Installing for user: org.kde.Platform.Locale/x86_64/5.15 from flathub
Warning: Failed to install org.kde.Platform.Locale/x86_64/5.15: Disk quota exceeded
Installing for user: com.github.debauchee.barrier/x86_64/stable from flathub
error: Failed to install com.github.debauchee.barrier/x86_64/stable: Disk quota exceeded

Unfortunately, this also left flatpak in a state where I couldn't uninstall what it did manage to install:

$du -sh ~/.local/share/flatpak
1.3G	/home/XXXX/.local/share/flatpak
$flatpak list --show-details
Ref                          Origin  Active commit Latest commit Installed size Options     
org.kde.Platform/x86_64/5.15 flathub 4820a00d9526  -             1.0 GB         user,runtime
$flatpak uninstall org.kde.Platform
Uninstalling from user:
org.kde.Platform/x86_64/5.15
Is this ok [y/n]: y
Uninstalling for user: org.kde.Platform/x86_64/5.15
error: Failed to uninstall org.kde.Platform/x86_64/5.15: mkdir(/home/XXXX/.local/share/flatpak/.removed): Disk quota exceeded
$flatpak repair --user
Verifying flathub:appstream2/x86_64...
Removing non-deployed ref flathub:runtime/org.kde.Platform/x86_64/5.15...
Pruning objects
$du -sh ~/.local/share/flatpak
1.3G	/home/XXXX/.local/share/flatpak

Using the --filesystem option made no difference, as this appears to be runtime related rather than install time related.

Checking the documentation for solutions

I looked at the documented options to add a custom installationlocation, but they only apply to --system installs and I can't use the --installation option because
a) I cannot create files in /etc/flatpak/installations.d/ as suggested by #1224 as I don't have root access to this machine.
b) The --installation option does not appear to be compatible with the --user option anyway.

Workaround

The workaround I found was to replace ~/.local/share/flatpak with a symbolic link to an external location .

Ref                                                     Origin  Active commit Latest commit Installed size Options     
com.github.debauchee.barrier/x86_64/stable              flathub 786ba72aa052  -               8.6 MB       user,current
org.freedesktop.Platform.GL.default/x86_64/20.08        flathub 3fbdbccc95ab  -             313.1 MB       user,runtime
org.freedesktop.Platform.GL.nvidia-460-73-01/x86_64/1.4 flathub b44739fde59e  -             984.1 kB       user,runtime
org.freedesktop.Platform.openh264/x86_64/2.0            flathub 73f998362a6f  -             778.2 kB       user,runtime
org.kde.KStyle.Adwaita/x86_64/5.15                      flathub 02860ce9758a  -              17.3 MB       user,runtime
org.kde.Platform/x86_64/5.15                            flathub 4820a00d9526  -               1.0 GB       user,runtime
$du -sh ~/.local/share/flatpak/ ~/.local/share/flatpak
1.8G	/home/XXXX/.local/share/flatpak/
0	/home/XXXX/.local/share/flatpak

Steps to reproduce

Run flatpak install --user with a project which (along with it's dependencies) is larger than the available quota on the user's home directory.

@refi64
Copy link
Collaborator

refi64 commented Sep 13, 2021

You can define custom installations where apps will be stored.

@refi64 refi64 closed this as completed Sep 13, 2021
@Mark-Booth
Copy link
Author

Unless I'm missing something, or the documentation is out of date, it is not possible to define custom installations without root access to a system, and even if you could, you can't install --user application in those custom locations.

As I said in my report:

I looked at the documented options to specify an alternative install location, but they only apply to --system installs and I can't use the --installation option because
a) I cannot create files in /etc/flatpak/installations.d/ as suggested by #1224 as I don't have root access to this machine.
b) The --installation option does not appear to be compatible with the --user option anyway.

@Mark-Booth Mark-Booth changed the title Flatpak should allow custom user install locations Flatpak should allow custom --user install locations Sep 16, 2021
@Bleuzen
Copy link

Bleuzen commented Jan 14, 2023

@refi64

You can define custom installations where apps will be stored.

This is only possible with root for system installations.
However, this issue is about custom USER installations, which still seem to be not possible.
Please reopen.

@refi64
Copy link
Collaborator

refi64 commented Jan 16, 2023

...indeed, I apparently can't read and also missed the previous comment pointing that out, oops 😅

@refi64 refi64 reopened this Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants