Is synaptic package manager open? Are you running updates? That error means something is using apt at the moment. You will need to close that to install anything.
The root of your problem seems to be that you don't have the proper video codecs installed to play your file. I am guessing that by "def file" you are referring to a .deb file which is causing some confusion in your post. What you need to do is see what kind of file you are trying to play...whether it's a .avi or .mp4 or whatever, and google "ubuntu play .avi" (fill in the proper file type)
Follow the directions and you should be playing movies in no time.