Question: how do you fix an error occurred while preparing the installation?
Answer: Restart your Mac. Simply restart your Mac to see if this fixes your problem.
Check the date and time. Make sure that the date and time on your Mac are set correctly. Here is how you can check this: ... 
Try installing in Safe Mode. Turn off your Mac. ... 
Use macOS Recovery. Turn off your Mac. ... 
Use a combo update.