Show pageOld revisionsBacklinksExport to PDFBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. <WRAP group> <WRAP round box twothirds column> {{ :systems:flatpak_logo.png?nolink&200 |}} ====== Flatpak ====== [[https://flatpak.org/|Flatpak]] is a portable software packager for native Linux software deployment. It has been designed to offer a sandbox environment in which users can run applications in isolation from the rest of the system. This means that Flatpak software can run on virtually any Linux distribution... including Batocera. <WRAP center round alert> This is currently supported only for x86_64, as most Flatpak packages are only provided for Linux on the x86/x86_64 platform. </WRAP> <WRAP center round help> Although we aim to have all Flatpaks functioning, we can't guarantee 100% compatibility; audio tends to be a common issue. Report any issues you find to our [[https://github.com/batocera-linux/batocera.linux/issues|Github]]/[[https://discord.com/invite/JXhfRTr|Discord]] server (check for duplicates first). Common issues: no PS4 controller support, cannot install Flatpaks if using a NAS for your SAVES directory, audio is absent on some configurations, some games think the D-pad is eternally being pressed down on certain controllers, apps that depend on opening the file browser crash upon doing so, etc. </WRAP> <WRAP center round help> If you still want to use a NAS for the rest of your systems' saves, [[:troubleshooting#nas_workaround_for_affected_systems|Flatpaks can still be installed to internal storage as a workaround]]. </WRAP> <WRAP center round tip> [[systems:steam|Steam]], [[systems:heroic|Heroic]], [[systems:geforcenow|GeForce NOW]] and [[systems:bottles|Bottles]] have their own pages. </WRAP> This system scrapes metadata for the "flatpak" group and loads the ''flatpak'' set from the currently selected theme, if available. Grouped with the "ports" group of systems. </WRAP> <WRAP third column> {{ :systems:flathub_logo.png?nolink |The default Flatpak repository: Flathub.}} </WRAP> </WRAP> ==== Quick reference ==== * **Emulator:** [[#flatpak|Flatpak]] * **Folder:** ''/userdata/roms/flatpak'' * **Accepted ROM formats:** ''.flatpak'' ===== Application files ===== Unlike with most systems, Flatpaks aren't actually installed to its ROM folder at ''/userdata/roms/flatpak''. No no, here only the shortcuts to them are stored. The actual Flatpaks themselves are installed to the SAVEs folder at ''/userdata/saves/flatpak''. ===== How to install a Flatpak ===== ==== Using flatpak-config ==== On Batocera **v31**, if this is your first time using Flatpak on the system, you'll have to add the repository first. One of the most popular is the [[https://flathub.org/home|Flathub repo]]. To do that, first [[:access_the_batocera_via_ssh|connect to your Batocera via SSH]] or use xterm (''[F1]'' on system list -> **Applications**) and run the following command (while connected to the internet): <code> flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo </code> Batocera **v32** and higher already have this set as the default repository. In Batocera **v32** and higher, you can then launch ''flatpak-config'' from the file manager (''[F1]'' -> Applications) to search for and install Flatpaks. {{ blog:screenshot-2021.09.03-21h47.05.jpg |F1 -> Applications}} {{ blog:screenshot-2021.09.03-14h03.37.jpg?720 |The flatpak-config menu. Pretty basic but it works.}} --> Two cursors on-screen?# <WRAP center round help> There's a bug affecting **v32** where two cursors are displayed. The one you're controlling is the white one. This has since been fixed. {{ blog:screenshot-2021.09.03-14h12.33.jpg?nolink&480 |Screenshot showing both the white and black cursors. It's like that one gif of Spiderman pointing at himself.}} </WRAP> <-- This is also where you would [[#updating_flatpak_packages|upgrade your packages]] in the future. ==== Using the terminal/SSH ==== First of all, you need to connect to [[:access_the_batocera_via_ssh|Batocera through SSH]]. Then, you need to add your Flatpak remote repo to the system. One of the most popular is the [[https://flathub.org/home|Flathub repo]]. flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo Once your repo is added, you can search for the software you want to install. In our example here, we are going to install [[https://store.steampowered.com/|Steam]]. So, let's search for it: flatpak search Steam Name Description Application ID Version Branch Remotes Steam Manage and play games distributed by Ste? com.valvesoftware.Steam 1.0.0.70 stable flathub Boxtron Compatibility tool to run DOS games on S? ?Steam.CompatibilityTool.Boxtron stable flathub vkBasalt A Vulkan post processing layer for Linux ?software.Steam.Utility.vkBasalt 0.3.2.4 stable flathub protontricks A simple wrapper that does winetricks th? ?ware.Steam.Utility.protontricks 1.5.2 stable flathu (...) The piece of software we want to install, Valve's Steam client, is the first one. It can be installed with: flatpak install com.valvesoftware.Steam Looking for matches? Found similar ref(s) for ?com.valvesoftware.Steam? in remote ?flathub? (system). Use this remote? [Y/n]: Y Required runtime for com.valvesoftware.Steam/x86_64/stable (runtime/org.freedesktop.Platform/x86_64/20.08) found in remote flathub Do you want to install it? [Y/n]: Y com.valvesoftware.Steam permissions: ipc network pulseaudio wayland x11 devices bluetooth devel multiarch per-app-dev-shm file access [1] dbus access [2] system dbus access [3] tags [4] [1] xdg-music:ro, xdg-pictures:ro, xdg-run/app/com.discordapp.Discord:create [2] org.freedesktop.Notifications, org.freedesktop.PowerManagement, org.freedesktop.ScreenSaver, org.gnome.SettingsDaemon.MediaKeys, org.kde.StatusNotifierWatcher [3] org.freedesktop.UDisks2, org.freedesktop.UPower [4] proprietary ID Branch Op Remote Download 1. org.freedesktop.Platform.Compat.i386 20.08 i flathub < 152.6?MB 2. org.freedesktop.Platform.GL.default 20.08 i flathub < 106.4?MB 3. org.freedesktop.Platform.GL32.default 20.08 i flathub < 114.1?MB 4. org.freedesktop.Platform.Locale 20.08 i flathub < 322.2?MB 5. org.freedesktop.Platform.VAAPI.Intel 20.08 i flathub < 11.6?MB 6. org.freedesktop.Platform.openh264 2.0 i flathub < 1.5?MB 7. org.freedesktop.Platform 20.08 i flathub < 268.1?MB 8. com.valvesoftware.Steam stable i flathub < 13.5?MB Proceed with these changes to the system installation? [Y/n] ID Branch Op Remote Download 1. [?] org.freedesktop.Platform.Compat.i386 20.08 i flathub 140.4?MB / 152.6?MB 2. [?] org.freedesktop.Platform.GL.default 20.08 i flathub 105.8?MB / 106.4?MB 3. [?] org.freedesktop.Platform.GL32.default 20.08 i flathub 113.8?MB / 114.1?MB 4. [?] org.freedesktop.Platform.Locale 20.08 i flathub 140.6?MB / 322.2?MB 5. [?] org.freedesktop.Platform.VAAPI.Intel 20.08 i flathub 11.5?MB / 11.6?MB 6. [?] org.freedesktop.Platform.openh264 2.0 i flathub 1.5?MB / 1.5?MB 7. [?] org.freedesktop.Platform 20.08 i flathub 222.5?MB / 268.1?MB 8. [?] com.valvesoftware.Steam stable i flathub 12.3?MB / 13.5?MB Installation complete. Now, the Flatpak package is installed, but you need to tell Batocera to show it up in the EmulationStation menu (under **Ports**): batocera-flatpak-update adding Steam updating permissions on files. ==== Manually placing the files ==== Let's say you've got yourself a fine and dandy Flatpak package in its physical folder form and you want to tell Batocera to just use that instead of searching for it in a repository. This is simple: - Move the folder containing your Flatpak package to ''roms/flatpak/'' - Then just run ''flatpak install <name of package>'' So for example if I had ''emby-theater-snap_3.0.15_amd64'', I would move it to ''roms/flatpak/emby-theater-snap_3.0.15_amd64'' and then run: <code> flatpak install emby-theater-snap_3.0.15_amd64.snap </code> ===== Updating Flatpak packages ===== <WRAP center round important> Note: Flatpak is an isolated environment by default unless you are configuring it otherwise manually. Therefore you can always safely update any flatpak packages without having to worry your Batocera system will be affected in any way other than flatpak package installations. All packages appearing in the //flatpak-config// update list are only part of existing flatpak package installations on your system and will only affect those. However, keep in mind, that updating those packages //could// affect an existing flatpak package installation in a negative way but this is very unlikely. Generally said, it is safe for existing flatpak package installations to install any of those updates. </WRAP> Updating Flatpak packages is simple: open ''flatpak-config'' and click **Upgrade**. All applicable packages will be updated to their latest version. You may be asked to reboot. Alternatively, this can be done by running the following command via SSH: <code> flatpak update </code> Type in ''Y'' and hit ''[Enter]''. ===== Uninstalling Flatpak packages ===== :-( A sometimes necessary evil. You can use the same ''flatpak-config'' tool to remove them or run the command: <code> flatpak uninstall <name-of-package-here> </code> Don't worry about spelling the package's name precisely, Flatpak will search your system for matching results and ask you if it's the correct one to uninstall first. <WRAP center round help> Unfortunately, for now at least, the ''.flatpak'' file from the ''/userdata/roms/'' directory must be removed manually in order to remove the entry from your game list too. </WRAP> ===== Cleaning unused Flatpak packages ===== <WRAP center round help> This command used to be buggy on **v32** and below, it is not advised to use it on older Batocera versions. [[https://github.com/batocera-linux/batocera.linux/issues/4568|Link to the related issue report.]] </WRAP> So you've been using Flatpak packages for a while now, you may have noticed that some applications need to install "runtimes" and other libraries to function. It's safe to leave these packages, and even multiple versions of the same package even, on a system after you no longer need the package that initially installed it. However over time they can take up quite some space, especially if you've been installing and uninstalling games as you play through them. So you could uninstall these packages one by one, but that would take an inordinate amount of time especially if you have to shift through which packages are //really// no longer required and which ones are. There's a simple command you can run instead to do all that for you: <code> flatpak uninstall --unused </code> ===== Freely distributed games ===== Here are some lists of [[https://github.blog/2021-08-25-30-free-and-open-source-linux-games-part-1/|freely]] [[https://github.blog/2021-08-26-30-free-and-open-source-linux-games-part-2/|distributed]] [[https://github.blog/2021-08-27-30-free-and-open-source-linux-games-part-3/|Linux games]]! ===== Controls ===== Here are the default controls used in Flatpak games shown on a [[:configure_a_controller|Batocera Retropad]]: {{ https://raw.githubusercontent.com/batocera-linux/batocera-controller-overlays/master/solid-4k/flatpak.png }} Obviously, applications designed for a mouse and keyboard interface will probably only work when those are connected. ===== Troubleshooting ===== ==== My Flatpaks (including Steam) won't launch! ==== Try one of the following: * Update your game list: **Main Menu** -> **Game Settings** -> **Update Gamelists**. * Flatpaks currently do not work on a NAS, if you are using a NAS try switching to internal storage. * The application may need to not be run in the sandbox. From [[:access_the_batocera_via_ssh|SSH]], run ''%%flatpak run <name-of-package> --no-sandbox%%'' to test for this. <WRAP center round tip> This can be launched directly from ES by using an SH script in the ports system. For example, to launch the Heroic Games launcher without sandbox, save the following file to ''roms/ports'' and then update the gamelist: <file - heroicgameslauncher.sh> flatpak run com.heroicgameslauncher.hgl --no-sandbox </file> </WRAP> * SSH into Batocera and run the following: ''batocera-flatpak-update'' * If you are on an older Batocera version (like **v31** or lower) it might be a permissions issue. - Press ''[F1]'' on your keyboard to enter into File Manager - Ensure you are in the Share folder (left in the sidebar) - Navigate to the ''saves'' folder - Select everything by pressing ''[Ctrl]'' + ''[A]'' - Right-click and go to **Properties** - Click on the "Permissions" tab - Click on "View Content:" and choose "Anyone" - Click on "Change Content:" and choose "Anyone" - Click on "Access content:" and choose "Anyone" - Click on "OK" - Reboot and try it * If trying to run a Flatpak of a Windows game via a Flatpak of Wine (yes, it is complicated and there are many things that can go wrong), search the game on [[https://www.protondb.com/|the ProtonDB]] and see what other users have said they've had to do to make it work. You may need to utilize custom launch commands to get a game working. * Flatpak can be effectively reset to its default state by deleting the ''/userdata/saves/flatpak/'' and ''/userdata/roms/flatpak/'' folders. ==== My game is running really slowly ==== * If using a Nvidia GPU, [[:supported_pc_hardware#nvidia_drivers|make sure your official Nvidia graphics drivers are enabled and functional]]. * Sometimes, Flatpak will "forget" that you have drivers and will need to "redownload" them (you'll find Steam is suddenly lagging in its menus). Run ''flatpak update'' in the [[:access_the_batocera_via_ssh|SSH]] and if it starts downloading ''org.freedesktop.Platform.GL.nvidia-###-##-##'' then that is what happened. * Try reinstalling the game and ensure all of its dependencies are sorted out, with no errors. * PC games in general (especially ones that were ported from home consoles //to// PC) can be buggy. Check out the [[https://www.pcgamingwiki.com/wiki/Home|PCGamingWiki]] for general tips, settings configurations, [[#setting_up_launch_commands|launch commands]] and patches you can apply to fix the game (just keep in mind it's focused on Windows, not Linux (and thus, not Batocera) so a lot of external programs/patches won't be compatible). ==== My controls in-game are not working ==== Unfortunately some games are just garbage at supporting certain controllers. Refer to the [[https://www.pcgamingwiki.com/wiki/Home|PCGamingWiki]] for general tips, but if you're still struggling to get your controller recognized by the game, see if it would be possible to get the game running from [[systems:steam|Steam]]. Once that's done, it should be possible to use Steam to configure the controls, allowing you to use any controller that would be compatible with Steam instead. ==== Further troubleshooting ==== For further troubleshooting, refer to the [[:support|generic support pages]]. systems/flatpak.txt Last modified: 3 months agoby maximumentropy