Since I don't have a system in a similar state as yours I can't do any testing. Any advice I give will just be me guessing at what to do. Someone else might have a better idea.
I would suspect that the cleanup should only run if there are other nvidia packages already installed, so you might just want to remove all nvidia packages if you haven't already.
To shut down the x server I think this would be the easiest approach:
go to a terminal (e.g.. ctrl+f1), and do
Code: Select all
sudo service gdm3 stop
Then unload the nvidia driver:if it's loaded
Code: Select all
sudo rmmod nvidia
I can't give you any specific advice though.