22

For the past month or so, since upgrading to Ubuntu 24.04 (during the beta period), I've been getting this error when launching Flatpak applications from Gnome-Software or the terminal:

ldconfig failed, exit status 256

When I launch them otherwise, of course, there's no error, but also no apps.

Running: sudo flatpak -v repair --reinstall-all does fix the issue, but only temporarily. Installing any other Flatpak, or installing updates, immediately brings the error back.

Sometimes, the error also seems to be triggered when an application (for example Inkscape), crashes. After this, the application in question (possibly sometimes others) will no longer open until I repair everything as stated above.

I've been scouring the internet for solutions but coming up short. What should I do to get back to a normal, working state?

RolandiXor
  • 51,957

3 Answers3

31

Per this comment on the bug report for this issue:

Basically create the file /etc/apparmor.d/bwrap with the following contents :

abi <abi/4.0>,
include <tunables/global>

profile bwrap /usr/bin/bwrap flags=(unconfined) { userns,

Site-specific additions and overrides. See local/README for details.

include if exists <local/bwrap> }

and execute:

sudo systemctl reload apparmor
pwaterz
  • 517
  • 5
  • 6
  • 1
    Fixed it for me! – Mouradif Oct 14 '24 at 11:15
  • i already had /etc/apparmor.d/bwrap exactly as such, and executing reload just gave me a red msg "apparmor.service is not active, cannot reload." however @inksz answer below worked wonders! http://askubuntu.com/a/1526971/7911 – cregox May 15 '25 at 09:48
  • Woah! This seems like magic, being able to open apps from Gnome Software. Genius! Thanks for your help! – Fred Rocha Jun 24 '25 at 09:02
7

From the original post (for Ubuntu 23.10) to disable the new constraints:

https://ubuntu.com/blog/ubuntu-23-10-restricted-unprivileged-user-namespaces

sudo sysctl -w kernel.apparmor_restrict_unprivileged_unconfined=0
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
lnksz
  • 171
  • 1
    Won't this disable the unprivileged user namespace system wide? – Malay Shah Jan 23 '25 at 19:24
  • @MalayShah my ai (cognix) said "yes". after i installed it, though, i just set it back to "1" and it will be all good until next update, i suppose. for a better approach, i will write an answer soon, based on cognix. – cregox May 15 '25 at 10:01
  • lol, i just noticed sen has a strict and apparently unreasonable (like all strict policies) policy against ai: https://askubuntu.com/help/gen-ai-policy so, whatever... ofc ai can get it wrong, but i feel the policy don't care if i verify everything or not: if the source of inspiration came from ai, then it will not be welcomed in sen. wait a few months until they catch up. tldr: i will not write an answer anymore, but i will still use cognix's answer myself, and go with flatpak override --user --filesystem=host com.zen.browser instead of sysctl. – cregox May 15 '25 at 10:08
-1

I am getting the same issue. I tried doing a fresh uninstall and install of flatpak flathub, without any luck.

  • Have you tried inspecting the issue?:

    flatpak --verbose run io.github.ungoogled_software.ungoogled_chromium

  • My error was due to missing pulseaudio config:

    Pulseaudio user configuration file '/home/user/.config/pulse/client.conf': Error opening file /home/user/.config/pulse/client.conf: No such file or directory

  • I resolved the issue by installing pulseaduio again and flatpak apps seem to be running fine.

I know this was how I solved the issue for particular application but maybe you could try this to resolve the issues you have. Good Luck!