Skip to content

Commit 83ab7fa

Browse files
committed
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.
1 parent c04b919 commit 83ab7fa

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

pkg/debian/build.sh

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

0 commit comments

Comments
 (0)