The commands in this article are run on Debian 12 Bookworm. If your system is Ubuntu or any other Debian based distribution, the default locations may be different, but the instructions remain same.
Assuming you have downloaded NVIDIA Drivers from apt repository, (in case you have downloaded NVIDIA Driver from Website, please refer the 1st web page in References).
Ensure that Secure Boot is Off or Secure Boot is enabled in Audit Mode (Depends on your PC manufacturer UEFI). You could change Secure Boot mode in UEFI settings.
Here its in Deployed mode, change it to Audit mode.
Secure Boot state can be checked by