Bug#1135735: nvidia-graphics-drivers: Add helpful pre-install checks to postinst script
Ashwin Gundarapu
linuxuser509 at zohomail.in
Thu May 21 06:35:34 BST 2026
On Tue, 5 May 2026 16:00:53 +0530 Ashwin Gundarapu <linuxuser509 at zohomail.in> wrote:> Package: nvidia-graphics-drivers
> Severity: wishlist
> Tags: patch
>
> The NVIDIA driver installation often fails silently for new users.
> This patch adds read-only pre-install checks to the
> nvidia-kernel-support postinst script:
>
> 1. Kernel headers present — warns with exact apt command if missing
> 2. Secure Boot status — explains MOK enrollment steps if enabled
> 3. Nouveau loaded — warns to reboot after installation
>
> These checks are read-only and do not modify system configuration.
>
> --- debian/nvidia-kernel-support.postinst.in.orig 2026-05-05
> 15:25:02.733419459 +0530
> +++ debian/nvidia-kernel-support.postinst.in 2026-05-05
> 15:26:06.968982397 +0530
> @@ -4,6 +4,53 @@
> if [ "$1" = "configure" ]
> then
>
> + # Check if kernel headers are installed
> + if [ ! -d "/lib/modules/$(uname -r)/build" ] && [ ! -d
> "/lib/modules/$(uname -r)/source" ]; then
> + echo ""
> + echo "=============================================="
> + echo " NVIDIA Driver Installation - WARNING"
> + echo "=============================================="
> + echo " Kernel headers not found for $(uname -r)."
> + echo " The NVIDIA kernel module cannot be built without them."
> + echo ""
> + echo " Install them with:"
> + echo " sudo apt install linux-headers-$(uname -r)"
> + echo "=============================================="
> + echo ""
> + fi
> +
> + # Check if Secure Boot is enabled
> + if command -v mokutil >/dev/null 2>&1; then
> + if mokutil --sb-state 2>/dev/null | grep -q "SecureBoot
> enabled"; then
> + echo ""
> + echo "=============================================="
> + echo " NVIDIA Driver Installation - NOTE"
> + echo "=============================================="
> + echo " Secure Boot is enabled on this system."
> + echo " The NVIDIA kernel module must be signed to load."
> + echo ""
> + echo " After installation, enroll the DKMS key with:"
> + echo " sudo mokutil --import /var/lib/dkms/mok.pub"
> + echo " sudo mokutil --import
> /var/lib/nvidia/nvidia-modsign-key.pub"
> + echo " Then reboot. The MOK enrollment screen will appear."
> + echo "=============================================="
> + echo ""
> + fi
> + fi
> +
> + # Check if nouveau is currently loaded
Hi,
Just checking if there's any update on this patch or if any changes are needed. Happy to revise if there are concerns.
Thanks,
Ashwin
More information about the pkg-nvidia-devel
mailing list