I struggled with this for 3 days, and I was finally able to install Mojave. Before I proceed with any steps, please confirm that you are perhaps stuck at the same spot I was at:
- The installer stops when there's about 15 seconds remaining, an error shows up saying "An error occurred installing macOS", and clicking on 'OK' quits the installer.
- After this, open up Spotlight Search (Cmd + Space), type 'console' and press Enter. In the console sidebar to the left, click on the /var/log directory, and then select 'install.log' in the resulting sidebar.
- Check whether there are any error messages in the log stating 'Could not personalize boot/firmware bundle' or 'Failed to personalize with options'. You can use the search field to search for these messages. My error log looked exactly like djeux's log here: Re: Re: Mojave - "An error occurred installing macOS" error
If you see an error message that includes the above, the following solution might help:
- Create a new admin user using the steps mentioned here: http://osxdaily.com/2017/07/17/how-create-new-admin-account-mac/. You will need to reuse the password for admin logins, so use something handy.
- Login using the newly created admin user and run the Mojave installer again. It should install just fine this time. If it doesn't and if the console error log says that 'BridgeOS could not be updated' or something similar this time, disable the firewall by going to System Preferences > Security & Privacy > Lock button in bottom left > Turn Off Firewall. You can re-enable it later, but this part may be unnecessary to most people.
- The installation will be completed and you will be logged back into this newly created admin account. You can then log out and log back in to your usual admin account, and you can delete the other account and its home folder if necessary.
I have had conversations with about 6 different Apple support agents, and it seems like Apple may be unaware about this error in particular. I tried all their solutions, resetting the SMC, installing from safe mode, from internet recovery mode, disabling auto proxy discover, using an Ethernet adapter, and nothing worked except this.
They also suggested I try a bootable installer for Mojave, but that would've been time consuming and I haven't tried it yet as I found a better alternative before that. But if you the above solution didn't work, you can give it a try yourself by following the steps here: How to create a bootable installer for macOS - Apple Support
Let me know if you have any questions and I'll do my best to help!
-- Sufi