How to fix the Permission denied error in Flatpak

The Permission denied error message in Flatpak may occur whenever Flatpak runs into some trouble either with installing or updating an application. This error usually indicates that the current user does not have the correct permissions to install or update an application, and can usually be fixed with sudo command or the --user option. In this tutorial, we will explore several causes of the Permission denied error in Flatpak, and help you resolve it on your Linux system to get Flatpak working as intended once more.

In this tutorial you will learn:

  • How to install a Flatpak app with user permissions
  • How to check Flatpak installation for errors
  • How to check if user has permission to run Flatpak commands
How to fix the Permission denied error in Flatpak
How to fix the Permission denied error in Flatpak
Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Any Linux distro
Software Flatpak package manager
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

How to fix the Permission denied error in Flatpak




Run through the step by step instructions below for help in resolving the Permission denied error in Flatpak. Since there could be multiple causes for the error, we will go through several troubleshooting methods. One of them should definitely work for you.

NOTE
Keep in mind that if the Permission denied message is only occurring when trying to install a particular application, then it is likely that there is an issue with that specific software, and not with your own system config or Flatpak installation.
  1. Many times, the Permission denied error can be easily resolved by prefacing your Flatpak command with sudo. This grants temporary administrator permissions when executing your Flatpak install or update command, which is always required when installing an application for system wide use.
    $ sudo flatpak install [repo] [app id]
    
  2. If you need to avoid using sudo, then you will need to append the --user option to your Flatpak install command, which tells Flatpak to only install the application for the user, and not system wide.
    $ flatpak install --user [repo] [app id]
    
  3. If the application is still having trouble with being installed or updated, check that your installed Flatpak version and runtimes have not been corrupted:
    $ sudo flatpak repair
    
  4. Check your Flatpak applications for available updates (with sudo prepended):
    $ sudo flatpak update
    
  5. Ensure that your user has execute permissions for the Flatpak binary.
    $ ls -l /usr/bin/flatpak
    -rwxr-xr-x 1 root root 1307520 Mar 14  2022 /usr/bin/flatpak
    

    The user in question will at least need read and execute permissions. In the output above, you can see that all users on our test system have read and execute permissions to the binary, although the root user remains the owner. You can also check the permissions on the Flatpak’s installation directory:

    $ ls -l /var/lib/flatpak
    


Closing Thoughts

In this tutorial, we saw how to troubleshoot the Permission denied error in Flatpak on a Linux system. Most times, this is just a generic message that users receive when trying to execute a Flatpak install or update command when they do not have the proper permissions to do so. Using the sudo command or --user option will resolve this error 99% of the time, but it can also be a good idea to check your Flatpak installation for errors or necessary updates. In certain cases, you may find that your user does not have the proper permissions to execute the Flatpak binary.



Comments and Discussions
Linux Forum