Skip to content

Commit c8bd75c

Browse files
authored
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.
1 parent a0e6da0 commit c8bd75c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/debian/build.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ EOF
8686
#!/bin/sh
8787
8888
echo "Load apparmor pgAdmin profile..."
89-
apparmor_parser -r /etc/apparmor.d/pgadmin4
89+
if command -v apparmor_parser >/dev/null 2>&1; then
90+
apparmor_parser -r /etc/apparmor.d/pgadmin4
91+
else
92+
echo "Warning: apparmor_parser not found, skipping profile load. pgAdmin desktop may not work on Ubuntu 24+ with userns restrictions."
93+
fi
9094
EOF
9195
chmod 755 "${DESKTOPROOT}/DEBIAN/postinst"
9296
fi

0 commit comments

Comments
 (0)