Difference between revisions of "Flatpak"

From Funtoo
Jump to navigation Jump to search
m (remove reboot requirement)
m (fix user prompts)
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Flatpak is a container based method of using software. Flatpak software once installed works on any linux distribution as long as you have the Flatpak framework installed.
Flatpak is a container-based method of using software. Flatpak software once installed works on any Linux distribution as long as you have the Flatpak framework installed.
 
<h1> Installing </h1>
This guide is based off of the one created by Sakaki on github found [https://github.com/sakaki-/gentoo-on-rpi-64bit/wiki/Install-Flatpak-Applications-on-your-RPi here]. Their guide is meant for an RPi install of Gentoo.


<h2> Prepping the Kernel </h2>
<h2> Prepping the Kernel </h2>
Line 11: Line 8:
}}
}}


<h2> Setting up the Overlay </h2>
You will also need to ensure that the {{c|fuse}} module is loaded by default. This does not happen automatically using the official {{c|debian-sources}} kernel. To do this, type:
Run the following command and add the following info before saving.
 
{{console|body=
# ##i##nano -w /etc/portage/repos.conf/flatpak-overlay.conf
}}
 
{{file|name=/etc/portage/repos.conf/flatpak-overlay.conf|desc=An example flatpak-overlay file|body=
[flatpak-overlay]
priority = 50
location = /usr/local/portage/flatpak-overlay
sync-type = git
sync-uri = https://github.com/fosero/flatpak-overlay.git
auto-sync = Yes
}}
 
<br>
You will also need to edit the categories file and add the following.
{{console|body=
# ##i##nano -w /etc/portage/categories
}}
 
{{file|name=/etc/portage/categories|desc=An example categories file|body=
acct-group
acct-user
}}


Without this change to the /etc/portage/categories Flatpak will not install correctly and can cause compatibility issues with any flatpak software.
<br>
You do need to update the /etc/portage/package.accept_keywords file with the following information.
{{console|body=
{{console|body=
# ##i##nano -w /etc/portage/package.accept_keywords
###i## modprobe fuse
}}
{{file|name=/etc/portage/package.accept_keywords|desc=An example package.accept_keywords file|body=
# required by flatpak
sys-apps/flatpak * ~*
# dependencies of flatpak
acct-group/flatpak * ~*
acct-user/flatpak * ~*
dev-util/flatpak-builder * ~*
sys-apps/xdg-desktop-portal-gtk * ~*
sys-fs/libostree * ~*
}}
}}


<br>
To make this permanent, add the following line to {{c|/etc/conf.d/modules}}:
At this point you will want to update your repos with ego sync


{{console|body=
{{file|name=/etc/conf.d/modules|body=
# ##i##ego sync
modules="fuse"
}}
}}


<br>
<h2> Installing Flatpak </h2>
You can now install Flatpak with the following command.
You can now install Flatpak with the following command.
{{console|body=
{{console|body=
Line 69: Line 26:
}}
}}
<h2> Setting up the Flathub Repos </h2>
<h2> Setting up the Flathub Repos </h2>
To add the Flathub repo to Flatpak you just need to tun the following command, an important note is most Flatpak commands DO NOT need root and can be run as a standard user.
To add the Flathub repo to Flatpak you just need to run the following command, an important note is most Flatpak commands '''DO NOT''' need root and can be run as a standard user. To run the commands as a standard user, supply the --user option.


{{console|body=
{{console|body=
%FenixFeniks% ##i##flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
$ ##i##flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo --user
}}
}}


<h2> Installing Flatpak Software </h2>
<h2> Installing Flatpak Software </h2>
For funtoo most of the time you would install the Flatpak software through the terminal like so:
For Funtoo most of the time you would install the Flatpak software through the terminal like so:
{{console|body=
{{console|body=
%FenixFeniks% ##i##flatpak install flathub com.valvesoftware.Steam  
$ ##i##flatpak install flathub com.valvesoftware.Steam
}}
}}
All of the software from the Flathub repo has the terminal commands listed on their individual pages on the Flatpak website. If you install gnome-extra/gnome-software you can have a graphical interface for installing the software locally.
All of the software from the Flathub repo has the terminal commands listed on their individual pages on the Flatpak website. If you install gnome-extra/gnome-software you can have a graphical interface for installing the software locally.

Revision as of 08:09, January 19, 2021

Flatpak is a container-based method of using software. Flatpak software once installed works on any Linux distribution as long as you have the Flatpak framework installed.

Prepping the Kernel

Run the following command to enable kernel to generate namespaces for non-root users.

root # echo 1 > /proc/sys/kernel/unprivileged_userns_clone
root # echo 'kernel.unprivileged_userns_clone=1' > /etc/sysctl.d/unprivileged_userns_clone.conf

You will also need to ensure that the fuse module is loaded by default. This does not happen automatically using the official debian-sources kernel. To do this, type:

root # modprobe fuse

To make this permanent, add the following line to /etc/conf.d/modules:

   /etc/conf.d/modules
modules="fuse"

Installing Flatpak

You can now install Flatpak with the following command.

root # emerge -v sys-apps/flatpak

Setting up the Flathub Repos

To add the Flathub repo to Flatpak you just need to run the following command, an important note is most Flatpak commands DO NOT need root and can be run as a standard user. To run the commands as a standard user, supply the --user option.

user $ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo --user

Installing Flatpak Software

For Funtoo most of the time you would install the Flatpak software through the terminal like so:

user $ flatpak install flathub com.valvesoftware.Steam

All of the software from the Flathub repo has the terminal commands listed on their individual pages on the Flatpak website. If you install gnome-extra/gnome-software you can have a graphical interface for installing the software locally.

root # emerge -av gnome-extra/gnome-software

Important Notes for Nvidia Driver Users

During the installation of applications like Steam through the terminal after first install of Flatpak, Flatpak should detect that you are using the Nvidia drivers and have you select the correct one for it to use from the list. Make sure you select the driver that matches your system's driver. This has not been tested if you are installing software for the first time with gnome-software.