
Fix macOS installation errors by correcting the system date in Recovery Mode. A quick Terminal command can resolve 'An error occurred while preparing the installation' issues.
If you've ever encountered a frustrating error message while updating or reinstalling macOS, you're not alone. Thousands of people have faced this issue, and this guide will help you resolve it.
An error occurred while preparing the installation. Try running again.
This error typically appears during macOS installation or upgrade to Catalina, Mojave, High Sierra, or any other version. The most common cause? An incorrect system date.
Why Does This Happen?
The macOS installer checks certificates and expects the system clock to match current standards. If your Mac has been sitting unused, the internal battery may have drained, causing the date to reset. When the date is out of sync, the installation certificates appear invalid and the process fails.
How to Fix: Change Date via Terminal
Step 1: Boot into Recovery Mode
Restart your Mac and immediately hold down Command + R until you see the Apple logo or a spinning globe.
Step 2: Open Terminal
Once in Recovery Mode:
- Cancel the installation process if it's running
- Navigate to Utilities in the menu bar
- Select Terminal
Step 3: Check the Current Date
In Terminal, type the following command and press Return:
You should see output showing the current system date. If it's incorrect (showing a date from years ago), that's your problem.
Step 4: Set the Correct Date
Use this command format to set the correct date:
Each value should be a two-digit number. For example, to set November 16th, 2018 at 21:16:
Press Return to apply the change.
Step 5: Verify and Continue
Run the date command again to confirm the change was applied. Once correct:
- Type
exitor close Terminal - Return to the macOS installer
- The installation should now proceed normally
Summary
An incorrect system date is one of the most common causes of macOS installation failures. The fix is simple:
- Boot into Recovery Mode (Command + R)
- Open Terminal from Utilities
- Check date with
datecommand - Set correct date with
date MMDDhhmmYYformat - Retry the installation
If the problem persists after fixing the date, consider:
- Checking your internet connection
- Verifying your installation media
- Consulting Apple Support
If you're still having trouble, feel free to contact us at FilioTech. We're happy to help with macOS troubleshooting and support.
Topics
About the Author

Rafal Kukla
Founder & Technical Director
Rafal is the founder of FilioTech with over a decade of experience helping businesses with their technology needs. From Apple Mac support to cloud architecture, he brings practical solutions to complex technical challenges.
Stay Updated
Get notified about new articles, tutorials, and updates from FilioTech. No spam, unsubscribe anytime.