Fix the Linux Login Loop

1. While on the login screen:
Press Ctrl + Alt + F1
or Ctrl + Alt + F2 (Virtual instance)

2. Login to the shell prompt with username and password

3. Type the following commands:
dpkg --configure -a (fix any corrupted packages)
sudo apt-get update (update package repository)
sudo apt-get upgrade (upgrade the package repository)
sudo reboot (reboot the system)