[Ubuntu] Stuck on blue screen after login

While using Ubuntu 16.04 there was a unique issue we faced. The blue screen of death. Yes that is common in windows system, but here in Linux too we had similar issue

So here is how it looks like

 

 

Well, the issue is not some hardware issue. It seems some packages are broken

We fixed this by rebooting. After login once we get the blue screen, I switched to a terminal ctrl+alt+f1 and then running

sudo apt-get upgrade

This worked out for us. We simply rebooted and things were working properly as before.

In some cases, the above might not run, then the following command is suggested to be used to fix it.

sudo dpkg --configure -a

Ref:  askubuntu