Emacs version 24 is not officially part of Ubuntu as yet, but it is packaged by in an Ubuntu personal package archive (PPA) on launchpad.net https://launchpad.net/~cassou/+archive/emacs
Open a terminal window and run the following commands to add the personal package archive to your software library and install Emacs 24
sudo apt-add-repository ppa:cassou/emacs
sudo apt-get update
sudo apt-get install emacs-snapshot emacs-goodies-el
The best method I have found is to use EmacsForMacOSX, although some developers prefer Aquamacs or using homebrew. Have a look at the article Getting Started with Emacs 24 for MacOSX.
Gnu Emacs on windows