Well, it does say what is going on: apt-get can't get a "lock" on the package management files (basically, the guarantee it's the only one who can access it) So, the first idea would be that something else is installing. You get this, for example, if the "Software Updater" is updating your system and at the same you think "gee, I want to install something". The "Software Updater" got the lock, you try to get it and it's obviously refused.
Now, what you want is to figure out which process is actually having the lock. For that we're going to use lsof, which means "list open files". The file of interest is "/var/lib/dpkg/lock".
$ lsof /var/lib/dpkg/lock
Normally this should give you a process that "has" the lock. Close that process and you'll be fine.
If there is no process, it's most likely a stale lock. While I never needed to do it, I'd then remove the lock by issuing:
sudo rm /var/lib/dpkg/lock
Do note you can get the error when you forget "sudo" on package manager commands (apt, apt-get, aptitude, etc...), but yours included it.