A couple of months ago I ran the usual
sudo apt update && sudo apt upgrade
on my Ubuntu box and when I logged back in, there was no graphical user interface. Nothing. Not even a Ctrl-Alt-T into a terminal.
Press Ctrl-Alt-F2 to call up a command-line. Log in with your usual credentials. You can then fix the compiz problem by removing the local config files:
sudo rm -fr ~/.cache/compizconfig-1 sudo rm -fr ~/.compiz
Then try this if your session still does not load:
sudo rm -fr ~/.Xauthority sudo rm -fr ~/.config/autostart
sudo apt-get install --reinstall ubuntu-desktop unity compizconfig-settings-manager upstart
Reboot the machine and you should be able to log into Unity. Finally clear and restart the Unity Desktop by opening a terminal and typing:
sudo dconf reset -f /org/compiz/ setsid unity
So I have Unity back. More or less. I don’t seem to be able to right-click on the desktop and get a menu, and my wallpaper choices don’t seem to get saved, but it’s good to have some windows visible.
One thing I’ve discovered in the meantime is that I actually prefer the Gnome desktop!