How does aptitude determine what version of a package/application to install?

view full story

http://stackoverflow.com – So I wasted several days dealing with a lame Apache2 bug that was fixed in Februry 2012. I couldn't figure out why I was experiencing the bug still until I discovered my version Apache2 was a 2.2.x version even thought I built up the entire server from scratch Debian 6 on Nov 30, 2012. For some reason aptitude -install apache2 pulled 2.2.x instead of 2.4.x. I wish I had known not to assume aptitude will pull the latest stable build. Can anyone shed some light on how the repositories are managed and why aptitude would be pulling from the older maintained infrastructure instead of the 2.4.x (HowTos)