apt-get upgrade mess

I installed CUDA on Ubuntu from the *.run file, rather than the *.deb file, and later noticed that apt-get upgrade can lead to problems like X losing its 3D-acceleration, which causes a bunch of other problems in Ubuntu, until CUDA is reinstalled.

I’m guessing that the CUDA installer and dpkg step on each other’s feet when it comes to kernel drivers.

Is this something that would a *.deb installation is designed to prevent?

Yes, generally installing NVIDIA drivers from external repositories or from a deb package would make it play nicer with Ubuntu’s upgrade mechanisms. I’ve sometimes had drivers from repositories auto-update themselves with an apt-get upgrade, which can sometimes break things if the drivers don’t compile correctly for some reason. There’s probably a way to exclude certain packages from auto-updating I’m sure.