Hi!
I want to encrypt my Home folder, but I don’t want to encrypt my games, because it will slow down my 4 cores CPU.
I’ve searched many solutions how to change default path for Flatpak installations, but is confusing to me, so I need help. Any help would be appreciated, I want to learn, and it will definitively benefit others who want to have Home encrypted and still game without performance degradation.
My Flatpak folder with games now is:
/home/a/.var/app/com.valvesoftware.Steam/
It would be nice to have it outside of the Home folder. Thanks!
dalto
August 17, 2023, 9:27pm
2
You can just convert that path to a symbolic link to another location.
That way flatpak will still see it as /home/a/.var/app/com.valvesoftware.Steam/
but the data could be stored somewhere else altogether.
1 Like
I’m struggling with this tutorial:
opened 12:37PM - 18 Nov 18 UTC
closed 04:36PM - 19 Nov 18 UTC
### Information
Flatpak installs at the default location `/var/lib/flatpak`. So… all applications get installed inside this flatpak folder(runtimes/platform/applications ... everything in this folder) eating away at the /root partition.
**Method 1** : uses a simple hack making use of linux feature of symbolic links.
**Method 2** : uses the official flatpak feature to install applications at custom locations/paths.
### Method 1 : Unofficial 'HACK' method (this method makes sense ONLY if you have a separate partition for `/home` ... if /root & /home are on the same partition its useless to try this method)
Lets say your home is located at `/home/user` ... ('user' could be the name of your user and the same needs to be replaced with the actual user name on your system in place of `user` wherever found in the below commands)
`sudo mv /var/lib/flatpak /home/user`
`cd /var/lib`
`sudo ln -s /home/user/flatpak flatpak`
**that's it !!!** ... .... with the symbolic link at `/var/lib` ... all your flatpak applications will get routed and installed in your /home partition keeping the /root partition free.
### Method 2 : Official feature of installing it in a custom location of your choice by creating `extra.conf` file
Its best(not mandatory) if the following conditions are adhered to ...
- Its is best to have a separate partition on your internal hard disk(preferable) dedicated to installing flatpak applications.
- It is best to configure you linux OS to auto mount partition on boot ...
- Its is best to let the partitions mount at their default locations ... some OSes mount it in `/media/user` and some mount it in `/mnt`
- It is best to name/label the partition
The following commands are written assuming the default location being `/media/user` and partitions get auto mounted at this location ... make changes according to your own systems. ... i have a separate partition labeled it as Flatpak(name of the partition not the folder).
`sudo mkdir /media/muz/Flatpak/flatpak`
`sudo mkdir /etc/flatpak`
`sudo mkdir /etc/flatpak/installations.d`
`sudo gedit /etc/flatpak/installations.d/extra.conf`
Lets name this custom install location ...
Lets say i name it `myFlatpaks` ... you can use your own names instead, just make sure the name 'myFlatpaks' with your name in the commands/entries below.
Paste the following block in the extra.conf file and save it ...
```
[Installation "myFlatpaks"]
Path=/media/muz/Flatpak/flatpak/
DisplayName=myFlatpaks Installation
StorageType=harddisk
```
Now lets add the flathub remote to this custom install location ...
`flatpak --installation=myFlatpaks remote-add flathub https://flathub.org/repo/flathub.flatpakrepo`
Thats It !!!
**Advantages of using a Separate partition dedicated ONLY for flatpak applications.**
- In cases where the OS is reinstalled from scratch which involves formatting /root and /home partition. (Tested and Works)
- In cases where you are switching from one linux distro to another.(not yet tested as such a situation hasn't been encountered by me).
I like to call this setup of using a dedicated partition as 'INSTALL ONLY ONCE' setup !!!
### Commands to manage applications at this newly created custom install location.
**Install**
`flatpak --installation=myFlatpaks install flathub org.application.name`
**Uninstall**
`flatpak --installation=myFlatpaks uninstall flathub org.application.name`
**List**
`flatpak list` - to list all applications
`flatpak --installation=myFlatpaks list` - to list applications only from a specific installation location.
**Run**
`flatpak run flathub org.application.name`
After completion of the tutorial my installation defaults to /home/user/.var
Yes, it defaults to /home/user/.var path even if I do:
flatpak --installation=extra run com.valvesoftware.Steam
After completing the tutorial…
It’s too hard for me…
I did:
sudo mkdir -p /etc/flatpak/installations.d
sudoedit /etc/flatpak/installations.d/extra.conf
Inside is:
[Installation “extra”]
Path=/run/media/Flatpak/flatpak/
DisplayName=Extra Installation
StorageType=harddisk
And then:
flatpak --installation=extra remote-add flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak --installation=extra install com.valvesoftware.Steam
flatpak --installation=extra run com.valvesoftware.Steam
And it defaults to /home/user/.var/
I’m tired…
dalto
August 17, 2023, 10:17pm
6
You changed the path for root installations but your doing user installations.
Try using sudo flatpak --installation=extra install com.valvesoftware.Steam
Will it mean that I will run steam with sudo after? I don’t want it…
pebcak
August 17, 2023, 10:25pm
8
niereklamuj:
/home/user/.var/
Isn’t that where flatpak app’s data and config files are stored and not where the apps themselves are installed?
Sort of what ~/.config is for “regular” apps.
No, mine is installing inside this folder, there is Steam inside and Counter Strike.
I don’t get it, why it’s so hard, I know nothing right now…
For 5 years I’m on Linux and still confused. I don’t get it, I thought that learning curve would flatten, but it’s not the case…
pebcak
August 17, 2023, 10:34pm
11
I have no gaming flatpaks but otherwise, never ever any apps have been installed under .var for me.
On my systems .var contains only app data and configs.
pebcak
August 17, 2023, 10:43pm
12
flatpak --installations
should print the path to where flatpaks are installed on your system.
flatpak --installations
/run/media/Flatpak/flatpak
/var/lib/flatpak
So, now it’s changed. I’m so confused…
pebcak
August 17, 2023, 10:54pm
15
These are the locations where your flatpaks apps and runtimes are installed.
If you were to install flatpaks per user (not systemwide) they would be under ~/.local/share/flatpak.
dalto
August 17, 2023, 11:03pm
16
No. It controls where it gets installed.
It still makes directory in my /home/user/.var folder. I confirmed it by checking space on home folder before and after I run Steam.
I don’t get it. I will give up. Not worth my time. Linux is not what I expected, after 5 years still problems. Using Flatpak because Counter Strike was stuttering on newer mesa when Steam installed from pacman.
Really, Linux sux those days. I never thought that DT on YouTube were right, but he is, he is also using Flatpak because things breaks… What a waste of time.
system
Closed
August 19, 2023, 11:05pm
19
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.