How to fix lock /var/lib/dpkg/lock – open (11 Resource temporarily unavailable) Error

If you are getting the following error when you try to install any packages use the following tip to fix this