From 83ab7fab8595fa8639b6bbf396e4042cdfe2db2e Mon Sep 17 00:00:00 2001 From: Muhammad Aqeel Date: Tue, 10 Mar 2026 19:55:12 +0500 Subject: [PATCH] Fix apparmor_parser not found error in desktop postinst script 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 283cad7176a..c69fade9c71 100755 --- a/pkg/debian/build.sh +++ b/pkg/debian/build.sh @@ -84,7 +84,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