It is possible to install restricted codec packages such as Adobe Flash, MP3 codecs etc.. during the installation of the ubuntu OS. But if you forget to install them during the installation here is the solution.
After the installation it is recommended to update the repositories in order to make sure that the latest updates are installed.
Open the terminal and type the following command
sudo apt-get update && sudo apt-get upgrade
Install ubuntu Restricted Extras This will enable ubuntu to play popular file formats such as mp3, avi , Flash etc...
sudo apt-get install ubuntu-restricted-extras