When I tried to install a new nvidia-driver, the error message An NVIDIA kernel module 'nvidia' appears to already be loaded in your kernel appears.

We can resolve it by first finding the process using nvidia,

$ sudo lsof -n -w /dev/nvidia*

and killing all the process using it:

$ sudo kill -9 PID