Upgrading to the latest Emacs asap is NOT always a good idea.
For example, Emacs 24.4 has a bug that will make M-x
fail if evil-mode is used (https://bitbucket.org/lyro/evil/issues/437/m-x-is-undefined-in-emacs-244).
In my experience, it's better to wait 6 months to give third party plugins some buffer time to fix the compatibility issue.
But, if you don't care about the above issue. Here are the easiest way to install from source code.
Install Emacs into your HOME directory:
mkdir -p ~/myemacs24.5; ./configure --prefix=~/myemacs/24.5 --without-gtk --without-gtk3 --without-aqua --without-x --without-xpm --without-png --without-gif --without-alsa --without-tiff --without-jpeg --without-aqua --without-rsvg --without-xft --without-xaw3d --without-xim --without-xpm --without-dbus --without-makeinfo --with-x-toolkit=no --without-sound --without-sync-input --without-pop;make;make install
Install Emacs into default directory:
./configure --without-gtk --without-gtk3 --without-aqua --without-x --without-xpm --without-png --without-gif --without-alsa --without-tiff --without-jpeg --without-aqua --without-rsvg --without-xft --without-xaw3d --without-xim --without-xpm --without-dbus --without-makeinfo --with-x-toolkit=no --without-sound --without-sync-input --without-pop;make;sudo make install
I'm 100% sure my way will always work because I've been using this way on Ubuntu/Mint/Debian/Centos/Gentoo/ArchLinux for 4 years without any issue.