apt-get install build-essentials fails on Ubuntu 11.10 on aws ami-baba68d3

I ran: apt-get update

Then I was able to run the build-essential installation.


I was not able to install build-essential even after apt-get update. Actually apt-get also failed. This was (in my case) because Ubuntu moves the older version packages (after its support cycle ends) to different URLs. Thus, it will not be accessible to the package manager. The proper solution is to upgrade. But most of the time it is a difficult option, thus we can change the url inside /etc/apt/sources.list from ..in.archive.ubuntu.com/.. to ..old-releases.ubuntu.com/..

Thanks, please refer to the below for the complete explanation https://smyl.es/how-to-fix-ubuntudebian-apt-get-404-not-found-package-repository-errors-saucy-raring-quantal-oneiric-natty/