How to remove old driver versions

Hi there,

I have a GeForce GTX 1060 6GB that I’m using with Ubuntu 22.04. After a s/w update, I lost access to my second monitor. I eventually found the thread Nvidia Driver is not working on Ubuntu 22.04 which solved my problem, thanks generix!

In my case I’m using driver nvidia-driver-535 and running a 6.1 kernel:

$ dkms status
nvidia/535.54.03, 5.19.0-46-generic, x86_64: installed (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!)
nvidia/535.54.03, 6.1.0-1015-oem, x86_64: installed
$ uname -r
6.1.0-1015-oem

Is it safe to ignore the warnings above? My system seems to be working.

dpkg lists some old versions of libraries and drivers. Can I remove them? If so, how do I do that? sudo apt autoremove does remove them.

$ dpkg -l | grep nvidia | grep -v 535
rc  linux-image-5.15.0-1028-nvidia                  5.15.0-1028.28                          amd64        Signed kernel image nvidia
rc  linux-modules-5.15.0-1028-nvidia                5.15.0-1028.28                          amd64        Linux kernel extra modules for version 5.15.0 on 64 bit x86 SMP
rc  linux-modules-nvidia-530-5.19.0-42-generic      5.19.0-42.43~22.04.1                    amd64        Linux kernel nvidia modules for version 5.19.0-42
rc  linux-modules-nvidia-530-5.19.0-43-generic      5.19.0-43.44~22.04.1+2                  amd64        Linux kernel nvidia modules for version 5.19.0-43
rc  linux-modules-nvidia-530-5.19.0-45-generic      5.19.0-45.46~22.04.1                    amd64        Linux kernel nvidia modules for version 5.19.0-45
rc  linux-modules-nvidia-530-5.19.0-46-generic      5.19.0-46.47~22.04.1                    amd64        Linux kernel nvidia modules for version 5.19.0-46
ii  linux-modules-nvidia-530-generic-hwe-22.04      5.19.0-46.47~22.04.1+2                  amd64        Extra drivers for nvidia-530 for the generic flavour (dummy transitional package)
rc  linux-objects-nvidia-530-5.19.0-42-generic      5.19.0-42.43~22.04.1                    amd64        Linux kernel nvidia modules for version 5.19.0-42 (objects)
rc  linux-objects-nvidia-530-5.19.0-43-generic      5.19.0-43.44~22.04.1+2                  amd64        Linux kernel nvidia modules for version 5.19.0-43 (objects)
rc  linux-objects-nvidia-530-5.19.0-45-generic      5.19.0-45.46~22.04.1                    amd64        Linux kernel nvidia modules for version 5.19.0-45 (objects)
rc  linux-objects-nvidia-530-5.19.0-46-generic      5.19.0-46.47~22.04.1                    amd64        Linux kernel nvidia modules for version 5.19.0-46 (objects)
ii  linux-signatures-nvidia-5.15.0-76-lowlatency    5.15.0-76.83+2                          amd64        Linux kernel signatures for nvidia modules for version 5.15.0-76-lowlatency
ii  linux-signatures-nvidia-5.19.0-1028-lowlatency  5.19.0-1028.29~22.04.1+2                amd64        Linux kernel signatures for nvidia modules for version 5.19.0-1028-lowlatency
ii  linux-signatures-nvidia-5.19.0-46-generic       5.19.0-46.47~22.04.1+2                  amd64        Linux kernel signatures for nvidia modules for version 5.19.0-46-generic
ii  linux-signatures-nvidia-6.0.0-1018-oem          6.0.0-1018.18+2                         amd64        Linux kernel signatures for nvidia modules for version 6.0.0-1018-oem
ii  linux-signatures-nvidia-6.1.0-1015-oem          6.1.0-1015.15+2                         amd64        Linux kernel signatures for nvidia modules for version 6.1.0-1015-oem
ii  nvidia-prime                                    0.8.17.1                                all          Tools to enable NVIDIA's Prime
ii  nvidia-settings                                 510.47.03-0ubuntu1                      amd64        Tool for configuring the NVIDIA graphics driver
ii  screen-resolution-extra                         0.18.2                                  all          Extension for the nvidia-settings control panel

Thanks,
Roger