Had a number of issues with installing Mavericks or Yosemite on Macs that have had a dead battery.  By “dead” I mean, either run flat and left in a cupboard or on a desk for a week or more before we’ve got around to rebuilding them, or where the battery itself has died and needed replacing, before the software is rebuilt.

Each time we’ve had to do it, we’ve ended up scratching heads and usually ended up simply cloning a hard drive from a working machine.  Today, I had some time waiting for other tasks to complete, and managed to hit up Google for some research, one common thread hit me…

When a laptop battery dies, chances are that if you leave it long enough, any onboard backup battery for CMOS/BIOS/PRAM/NVRAM or whatever other backed up settings, and the onboard realtime clock, will eventually go flat too.

Usually the first sign on replacement or recharge is that the date and time are wrong.  So the first thing a Mac can do is either prompt the user that the date and time are wrong and need resetting, or if it’s already online it can contact an NTP server and correct itself.  But when you’re installing from scratch, it does neither of those things.  In fact, it doesn’t even show you what the date and time are, unless you go well out of your way and ask it.  So the first sign that something’s wrong at this stage is that you get an error message, like:

  • “An Error occurred while preparing the installation.  Try running this application again.”
  • “This copy of the Install OS X Yosemite application can’t be verified. It may have been corrupted or tampered with during downloading.”

The fix, to get an install going here this afternoon, was easy:

  1. Get the installer booting, either from an external USB drive, or from Target Disk Mode from another working Mac.
  2. Once the installer is loaded and showing you the main menu, you should be able to see the “Utilities” menu. Click on it, and go to “Terminal”.
  3. Check the current date and time from your watch or another machine/clock/device of your choice.  Convert it to the following numeric format, so that 6:15pm on 4th December 2014 becomes 120418152014, following the mmddHHMMyyyy format.
  4. Type the following into “Terminal”:  date {mmddHHMMyyyy string above, without these funny brackets}
  5. Press enter, if you haven’t done so already.

Date and time should now be accepted, and Terminal will confirm this.  If you did it correctly, the installers should now work without either of those errors.  Worked like a charm here!

Without Google, and particularly its quick realisation that I needed to be looking here, I’d never have even thought to check something like that, to get something like an installer going!