Well, how did you get on?
apt-get implies you are doing this for a debian-like distro.
Check out the
Ubuntu Guide, there is a whole section about installing multimedia codecs and getting mplayer to work for Hoary Hedgehog. If it's another debian, the packages will be the same and you just modify some of the commands.
For fedora and RH-like distros,
www.mjmwired.net is worth a look for the source installation instructions.