The "Could not get a lock /var..." warning only means that you have another package manager open when you tried running the command in terminal. Package management only allows one lock at a time. Closing out the other manager is all that is needed to resolve that.