Installing Mac OS X on iMac's blank formatted hard drive. Installation runs for 5-10 minutes and then fails with following error:
An error occurred while preparing the installation. Try running this application again.
Tried installing OS X El Capitan (10.11) and OS X Sierra (10.12) - the same error occurs in both cases.
Issue was resolved by fixing incorrect time on the iMac and then clearing NVRAM.
Fix incorrect time
- Boot from Mac OS X installation disk / USB.
- Go to Utilities > Terminal.
- Type date to check the current date and time.
- If it's incorrect, run following to fix the date and time: date mmddHHMMyyyy
Where: mm - month, dd - day, HH - hour, MM - minute, yyyy - year
- Shut down the Mac
- Start the Mac and as soon as you hear startup chime press and hold keys Command + Option + P + R.
- Keep holding the keys until Mac reboots and you hear another startup chime.
iMac 21.5'' (2009)
Mac OS X El Capitan (10.11)
Mac OS X Sierra (10.12)