If you want to install Emacs24 on an older Ubuntu such as 12.04 you can do it manually by adding the following repository and then installing.
First remove the emacsen you have which is probably emacs23
$ sudo apt-get remove emacs emacs23
Then add the new repository and update:
$ sudo add-apt-repository ppa:cassou/emacs $ sudo apt-get update
Then install Emacs24:
$ sudo apt-get install emacs24 emacs24-el emacs24-common-non-dfsg