Analyze the error.
ERR: could not get lock /var/lib/dpkg/lock - open (11 resources temporary not available) means that the lock is unavailable to the installer service.
...the administrative directory (/var/lib/dpkg/) another process using it. means that another process is using that directory.
/var/lib/dpkg directory is the directory that contains all of the resources the installer service needs to install and/or uninstall. The lock files are the files that the installer/uninstaller to 'lock' the directory so only he can use it. So if you were uninstalling something while the package was installing (or vice versa) the whole
/var/lib/dpkg directory was being used by Program B, and Program A isn't able to use it.
(think of it as if it was a restroom, two people can't use it at the same time! That's why you have to lock it. c;)
So the solution:
Wait until the other program finishes uninstalling, or any network traffic that has to do with automatically installed packages you can't see ends. Then install it. (the restroom would be vacant)