From c8bd75c9a8cf35f8c77c7fda607768b0cd9d73e0 Mon Sep 17 00:00:00 2001 From: Muhammad Aqeel Date: Tue, 10 Mar 2026 20:29:40 +0500 Subject: [PATCH] Fix apparmor_parser not found error in desktop postinst script (#9728) Add a runtime guard in the postinst so apparmor_parser is only called when available. Previously, packages built on Ubuntu 24+ would fail to install on headless servers or systems without AppArmor tools. A warning is printed when the profile load is skipped to aid debugging. --- pkg/debian/build.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/debian/build.sh b/pkg/debian/build.sh index 441d8b6aa..096f1e04a 100755 --- a/pkg/debian/build.sh +++ b/pkg/debian/build.sh @@ -86,7 +86,11 @@ EOF #!/bin/sh echo "Load apparmor pgAdmin profile..." -apparmor_parser -r /etc/apparmor.d/pgadmin4 +if command -v apparmor_parser >/dev/null 2>&1; then + apparmor_parser -r /etc/apparmor.d/pgadmin4 +else + echo "Warning: apparmor_parser not found, skipping profile load. pgAdmin desktop may not work on Ubuntu 24+ with userns restrictions." +fi EOF chmod 755 "${DESKTOPROOT}/DEBIAN/postinst" fi