How to prevent nvidia driver updates from Ubuntu software updater

On Ubuntu 22.04 I’ve avoided updating nvidia drivers on Ubuntu because previous updates have broken the existing driver leaving my system using the nouveau driver. Today I took a chance and allowed the software updater to update my nvidia driver and of course it failed. With some help from claude I found the root of the failure:


Jan 13 11:18:05 hpvictus packagekitd[2208]: Failed to fetch https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/InRelease  
                                           E: Failed to fetch https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/InRelease  
Jan 13 11:20:23 hpvictus AptDaemon[16929]: INFO: CommitPackages() was called: 

...

Jan 13 11:22:31 hpvictus AptDaemon.Worker[16929]: CRITICAL: /tmp/apt-dpkg-install-tWppUI/39-libnvidia-extra-535_535.216.03-0ubuntu1_amd64.deb: trying to overwrite '/usr/lib/x86_64-linux-gnu/libnvidia-api.so.1', which is also in package libnvidia-gl-535:amd64 535.183.01-0ubuntu0.22.04.1
Jan 13 11:22:31 hpvictus org.debian.apt[16929]: 11:22:31 AptDaemon.Worker [CRITICAL]: /tmp/apt-dpkg-install-tWppUI/39-libnvidia-extra-535_535.216.03-0ubuntu1_amd64.deb: trying to overwrite '/usr/lib/x86_64-linux-gnu/libnvidia-api.so.1', which is also in package libnvidia-gl-535:amd64 535.183.01-0ubuntu0.22.04.1

This was an update from 535.183 to 535.216. In order to fix this I had to purge all nvidia-* and libnvidia-* files and do a complete reinstall.

Is there a way to tell the software updater to ignore nvidia updates? The last few times I’ve allowed the software updater to update the nvidia driver it has failed. I want to avoid this in the future. If there is a good reason to do an updates I’ll do it manually since the updates from nvidia fail.

The nvidia maintainers seem to be doing sloppy work when comes to Ubuntu drivers. Nvidia is the richest company in the world and that is in no small part because Linux provides a platform for their gpus to run on. It’s disappointing that they can’t provide updates that work.

Nvidia is not involved at all in packing the nvidia drivers in the Ubuntu archive, if you have problems with the officially provided drivers from the Ubuntu archive you should open a bug (using the ubuntu-bug tool) in the first place so developers know about it …

I personally haven’t had any issues with my nvidia equipped systems over the last decade or so, so I know that at least in my case the updates work just fine and i would expect this to be the case for the majority of users, so have developers help you to identify what’s different with your setup …

Your issue above is clearly a packaging bug that I do not see here with the latest drivers on my machine

1 Like

I’m in same state as @ogra just no issues on upgrade or downgrade.

I will admit though Driver version 535 was my least favorite. :expressionless:

When you change the driver do you do a purge of nvidia-* and libnvidia-* followed by install or some other process?

Yep I’ve just gotten into the habit, to get the best result purge first, then my install.
My method involves:

sudo apt autoremove --purge nvidia*

Then my install goes like

sudo apt install nvidia-driver-xxx nvidia-dkms-xxx

Change “xxx” to your desired Driver version.
Currently using:

apt policy nvidia-driver-560 nvidia-dkms-560
nvidia-driver-560:
  Installed: 560.35.03-0ubuntu7
  Candidate: 560.35.03-0ubuntu7
  Version table:
 *** 560.35.03-0ubuntu7 500
        500 http://archive.ubuntu.com/ubuntu plucky/restricted amd64 Packages
        100 /var/lib/dpkg/status
nvidia-dkms-560:
  Installed: 560.35.03-0ubuntu7
  Candidate: 560.35.03-0ubuntu7
  Version table:
 *** 560.35.03-0ubuntu7 500
        500 http://archive.ubuntu.com/ubuntu plucky/restricted amd64 Packages
        100 /var/lib/dpkg/status

My GPU is

inxi -G | grep Device-1
  Device-1: NVIDIA GA107BM [GeForce RTX 3050 Ti Mobile] driver: nvidia

Hope that helps. :smiley:

Maybe the problem is with Ubuntu’s software updater.

I would like a way to exclude nvidia updates from that installer so I don’t accidentally include the nvidia driver updates with other upgrades.

I’m strictly a CLI user, no GUI’s for me.
But you could and not advised due to security concerns use.

 sudo apt-mark hold nvidia-driver-560 nvidia-dkms-560
[sudo] password for me: 
nvidia-driver-560 set on hold.
nvidia-dkms-560 set on hold.

To remove the hold:

sudo apt-mark unhold nvidia-driver-560 nvidia-dkms-560
[sudo] password for me: 
Canceled hold on nvidia-driver-560.
Canceled hold on nvidia-dkms-560.

But that could leave you vulnerable to any risks for that Diver.

1 Like

I’d prefer to do this through the software updater.

Have you used the Ubuntu software updater to update your drivers?

No I never use software managers, I have a saying Live by the GUI, Die by the GUI. Sorry I’m no help there.

Since I’ve chosen that method, I don’t seem to see the same breakage others report in forums.

Yes, indeed I use the software updater …

Are you sure you are not using the drivers from some third party repo that you set up in the past ?
(Not te that a packaging error like the one you show above wouldn’t have made it into the official archive ever, there are checks and tests for such cases)

BTW, to switch between drivers you can either use the software and updates app (the “additional drivers” page) or on the command line the ubuntu-drivers command… There is no need to involve apt ever into getting and managing Nvidia drivers

1 Like

Respectfully Agree to Disagree, especially if you have no software managers installed. (My Case)

ogra@styx:~$ dpkg -S $(which ubuntu-drivers)
ubuntu-drivers-common: /usr/bin/ubuntu-drivers
ogra@styx:~$ apt show ubuntu-drivers-common 2>/dev/null|grep Task
Task: cloud-minimal, ubuntu-desktop-minimal, ubuntu-desktop, server-minimal, ubuntu-desktop-raspi, kubuntu-desktop, xubuntu-minimal, xubuntu-desktop, lubuntu-desktop, ubuntustudio-desktop, ubuntustudio-desktop-core, ubuntukylin-desktop, ubuntukylin-desktop-minimal, ubuntu-mate-core, ubuntu-mate-desktop, ubuntu-budgie-desktop-minimal, ubuntu-budgie-desktop, ubuntu-budgie-desktop-raspi, ubuntu-unity-desktop, edubuntu-desktop-gnome-minimal, edubuntu-desktop-gnome-raspi, ubuntucinnamon-desktop-minimal, ubuntucinnamon-desktop-raspi
ogra@styx:~$ 

Given it is in server-minimal, cloud-minimal as well as ubuntu-desktop-minimal, I doubt there is any Ubuntu system without the ubuntu-drivers command out there :slight_smile:

I don’t use the bundled software manager to update. If you want a GUI use synaptic, it has the option to uncheck certain updates before you go ahead. Also you can use the gui to pin some packages so that they don’t get updated, or do it in the cli as 1fallen said.

You only have to apply the hold once and then it shouldn’t get update in the update manager (I think, as I don’t use the software updater)

Yep you show the Ubuntu preffered method… just not for me.
I’ve been burned too many times by that nifty little application.
Now we/I are straying off topic

1 Like

When I use the updater I use whatever the updater has.

The question is more how did you get these packages in the first place since they are rather broken …
normally a package properly declares if it wants to replace any files of other packages and dpkg will handle that (overwriting can not happen at all in that scenario).

whoever packaged these packages did not follow the debian packaging policy (something that is rather essential for stability on a deb based system) which is what causes your breakage

I’ve been dying to see this:

ls '/etc/apt/sources.list.d' 

1 Like

software updater is just a GUI that uses apt

I don’t recall which method I used to install the driver. It may have been from the original installation of Ubuntu 22.04.

The various ways of installing drivers shouldn’t stomp on each other, though.