Sorting out apt-get dist-upgrade and nvidia kernel modules on Ubuntu
I ran into some trouble with my Ubuntu 12.10 machine yesterday when running a few updates; I noticed
that after a normal apt-get update/upgrade a few packages had been “kept back.” Turns out apt-get
upgrade will refuse to remove or install new packages by default. If you want everything fully
updated, along with new transitive dependencies of existing packages, you need apt-get
dist-upgrade instead (1, 2, 3, 4, 5).
Unfortunately, when I ran apt-get dist-upgrade it upgraded my system’s kernel but didn’t recompile
existing kernel modules to work with it. The nvidia driver / kernel module failed to load on reboot,
causing the display manager and X to enter some awful video mode. Looks like others have run into
this issue before (6, 7). To get things back in order, I followed roughly these steps: