With this procedure you can install the latest version of Asterisk by compiling from source.voip-info shows us how to do it.
Read it here
Compiling Asterisk from Source on Ubuntu
Ubuntu includes packages for Asterisk and Zaptel, but they may not be up to date, or the newer packages may only be available in newer Ubuntu releases.
With this procedure you can install the latest version of Asterisk by compiling from source. Please keep in mind when compiling from source your installation will include experimental, preliminary and unreleased features and will be based on source code that may not be ready for a production environment.