How to rollback an apt-get upgrade if something goes wrong on a Debian or Ubuntu Linux

Rolling back to the previous version may solve the problem or free the disk space. Both CentOS/RHEL support rollback feature, but I learned hard way both Debian and Ubuntu does not support rollback feature yet. This blog post explains how to rollback massive package installation using shell kung-fu on a Ubuntu Linux 14.04.3 LTS server.