# Can't Install Using Flatpak

**URL:** <https://discuss.pencil2d.org/t/cant-install-using-flatpak/9516>\
**Category:** Help and Advice\
**Created:** [20 February 2025 17:10 UTC](https://discuss.pencil2d.org/t/cant-install-using-flatpak/9516 "2025-02-20T17:10:29Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![boko06](https://discuss.pencil2d.org/letter_avatar_proxy/v4/letter/b/df705f/32.png) [@boko06](https://discuss.pencil2d.org/u/boko06)\
**Post date:** [20 February 2025 17:10 UTC](https://discuss.pencil2d.org/t/cant-install-using-flatpak/9516/1 "2025-02-20T17:10:29Z")

</div>

I recently reinstalled pencil2d after a while, but had problems with hearing the audio within the program. This happened the last time I installed it, and back then, I was able to install the required plugin. That didn’t work this time, so I tried installing the AppImage, which still didn’t work. I saw an [old topic](https://discuss.pencil2d.org/t/importing-audio-doesnt-play-sounds/6867/2) with the same issue and the solution given was installing pencil2d using flatpak. When I ran the code in my linux terminal, I got this response: `Looking for matches… error: No remote refs found for ‘flathub’` That happens when I run it regularly and with `sudo`.

How should I resolve this?

---

<div class="post-metadata">

**Author:** ![Starter](https://discuss.pencil2d.org/user_avatar/discuss.pencil2d.org/starter/32/2567_2.png) [@Starter](https://discuss.pencil2d.org/u/Starter)\
**Post date:** [21 February 2025 02:17 UTC](https://discuss.pencil2d.org/t/cant-install-using-flatpak/9516/2 "2025-02-21T02:17:51Z")

</div>

I experienced this problem, which I solved using the instalation library, for the version of Linux I use, I my case Linux Mint.

---

<div class="post-metadata">

**Author:** ![scribblemaniac](https://discuss.pencil2d.org/letter_avatar_proxy/v4/letter/s/e5b9ba/32.png) [@scribblemaniac](https://discuss.pencil2d.org/u/scribblemaniac)\
**Post date:** [21 February 2025 07:54 UTC](https://discuss.pencil2d.org/t/cant-install-using-flatpak/9516/3 "2025-02-21T07:54:17Z")

</div>

The instructions on our website assume that you have already installed flatpak and set up the flathub repository (which is the main community repository for flatpak apps). You can find full setup instructions of these for your distribution [here](https://flathub.org/setup). Most likely you will just need to run `flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo`

---

<div class="post-metadata">

**Author:** ![boko06](https://discuss.pencil2d.org/letter_avatar_proxy/v4/letter/b/df705f/32.png) [@boko06](https://discuss.pencil2d.org/u/boko06)\
**Post date:** [21 February 2025 16:04 UTC](https://discuss.pencil2d.org/t/cant-install-using-flatpak/9516/4 "2025-02-21T16:04:13Z")

</div>

Thank you. I was able to install it, but now it crashes after a short time with this error `The cached device pixel ratio value was stale on window update. Please file a QTBUG which explains how to reproduce. qt.qpa.wayland: Ignoring unexpected wl_surface.enter received for output with id: 7 screen name: "Screen5" screen model: "unknown" This is most likely a bug in the compositor. qt.qpa.wayland: Ignoring unexpected wl_surface.enter received for output with id: 7 screen name: "Screen5" screen model: "unknown" This is most likely a bug in the compositor. The Wayland connection broke. Did the Wayland compositor die?`

---

<div class="post-metadata">

**Author:** ![scribblemaniac](https://discuss.pencil2d.org/letter_avatar_proxy/v4/letter/s/e5b9ba/32.png) [@scribblemaniac](https://discuss.pencil2d.org/u/scribblemaniac)\
**Post date:** [26 February 2025 06:24 UTC](https://discuss.pencil2d.org/t/cant-install-using-flatpak/9516/5 "2025-02-26T06:24:36Z")

</div>

Seems like some issue between Qt (the development framework Pencil2D uses) and your Wayland-based display server. Unfortunately there’s not a lot we can do about this, but I will try to look into the issue a bit more. Can you please tell me what Linux distribution & version you are using?

What you can try to do as a workaround is run `flatpak override --env=QT_QPA_PLATFORM=xcb org.pencil2d.Pencil2D` in your terminal. This should force the Pencil2D flatpak to run with XWayland instead, which you may have better luck with.

---

<div class="post-metadata">

**Author:** ![boko06](https://discuss.pencil2d.org/letter_avatar_proxy/v4/letter/b/df705f/32.png) [@boko06](https://discuss.pencil2d.org/u/boko06)\
**Post date:** [26 February 2025 16:08 UTC](https://discuss.pencil2d.org/t/cant-install-using-flatpak/9516/6 "2025-02-26T16:08:33Z")

</div>

I am using a Debian Bullseye VM on a Chromebook. Here’s my `uname -a` output. `Linux penguin 6.6.56-05934-gf790fe104dba #1 SMP PREEMPT_DYNAMIC Wed, 25 Dec 2024 22:23:38 -0800 x86_64 GNU/Linux1`

---

<div class="post-metadata">

**Author:** ![boko06](https://discuss.pencil2d.org/letter_avatar_proxy/v4/letter/b/df705f/32.png) [@boko06](https://discuss.pencil2d.org/u/boko06)\
**Post date:** [26 February 2025 16:09 UTC](https://discuss.pencil2d.org/t/cant-install-using-flatpak/9516/7 "2025-02-26T16:09:46Z")

</div>

After running the override command, I got this output.

```auto
qt.qpa.xcb: could not connect to display 
qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin.
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vkkhrdisplay, vnc, wayland-egl, wayland, xcb.

```

---

<div class="post-metadata">

**Author:** ![scribblemaniac](https://discuss.pencil2d.org/letter_avatar_proxy/v4/letter/s/e5b9ba/32.png) [@scribblemaniac](https://discuss.pencil2d.org/u/scribblemaniac)\
**Post date:** [16 March 2025 07:43 UTC](https://discuss.pencil2d.org/t/cant-install-using-flatpak/9516/8 "2025-03-16T07:43:58Z")

</div>

I have finally had a chance to take a closer look at this issue and I have an update for you @boko06.

I was not able to reproduce your first crash on Wayland. Looking more closely at the error messages, my best guess is that it might have something to do with your display setup. If you’re moving Pencil2D between screens with different pixel ratios for example, that could be related to these error messages.

As for it failing to start with XWayland, I was able to reproduce this issue. A fix for this is currently under review and I will follow up here with upgrade instructions once my changes have been accepted on flathub. This fix may also help with the first issue, I do not know for sure though.

---

<div class="post-metadata">

**Author:** ![scribblemaniac](https://discuss.pencil2d.org/letter_avatar_proxy/v4/letter/s/e5b9ba/32.png) [@scribblemaniac](https://discuss.pencil2d.org/u/scribblemaniac)\
**Post date:** [17 March 2025 07:22 UTC](https://discuss.pencil2d.org/t/cant-install-using-flatpak/9516/9 "2025-03-17T07:22:42Z")

</div>

Alright. So the changes I made have been accepted. First run `flatpak upgrade` to upgrade Pencil2D, and then `flatpak override --reset` to revert the previous override changes and start fresh. I recommend first just trying to run it like this. It’s possible that the upgraded version of Qt will fix whatever crash you were having with Wayland.

If you continue to get that crash after a short time, then I have a different set of instructions that you can try. You can start the application with `flatpak run --nosocket=wayland --nosocket=fallback-x11 --socket=x11 org.pencil2d.Pencil2D -platform xcb` . This is the _correct_ way to run the application without Wayland and shouldn’t produce the error your were seeing earlier. If Pencil2D does not crash when starting in this way, you can make it so it always starts with these arguments by running `flatpak override --nosocket=wayland --nosocket=fallback-x11 --socket=x11 --env=QT_QPA_PLATFORM=xcb org.pencil2d.Pencil2D` .

If you get a chance to try this, please let us know how it goes.

---

<div class="post-metadata">

**Author:** ![system](https://discuss.pencil2d.org/uploads/default/original/2X/b/be472d9d9c3e92d2432da03a00b781a7f15bc51b.png) [@system](https://discuss.pencil2d.org/u/system)\
**Post date:** [1 April 2025 15:51 UTC](https://discuss.pencil2d.org/t/cant-install-using-flatpak/9516/10 "2025-04-01T15:51:03Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
