Go to Applications > Ubuntu Software Center from the top panel go to Edit > Software Sources and click the ‘Other Software’ tab.Press ‘Add’ button and then paste the following line
After adding the PPA you will be prompted to update your sources.
Once the update is done you can head to System > Administration > Update Manager to perform an upgrade.
Install firefox 4 using terminal
Go to Applications > Terminal in the terminal just enter the following commands
sudo add-apt-repository ppa:mozillateam/firefox-stable sudo apt-get update sudo apt-get upgrade