Gigabyte RTX 2060 OC, Linux Mint 21.1 Cinnamon - Nvidia Driver Bug

I have a problem with the latest linux mint 21.1 with cinnamon environment. The system after installation was fully updated. The problem is that when I want to install the nvidia driver from the driver manager, e.g. version 525 or lower, it writes that:

**Error while installing package: installed nvidia-dkms-525 package post-installation script subprocess returned error exit status 10**

The card is rtx 2060 oc. I have secureboot and tpm enabled as I need windows 11 for my work. Sudo apt -f install does not do the trick. I changed the kernel to 5.19 and the problem is the same.

I am attaching the log from:
make.log (41.9 KB)


Generally on ubuntu 22.04 distros I have this problem. Once I install some fork ubuntu, or even ubuntu 22.10 original with gnome, there is no problem for nvidia.

I don’t know how to fix it, I’m new to linux.