What causes the "macOS could not be installed on your computer" error? Several issues could cause the problem. However, the error screen should give you some idea of what's gone amiss. Here are some messages you might see underneath the warning:
• The path /System/Installation/Packages/OSInstall.mpkg appears to be missing or damaged
• An error occurred installing macOS
• Unable to unmount volume for repair
• Storage system verify or repair failed
• An error occurred while verifying firmware
Some of these offer more information than others, but they point to different stages of the installation that failed. The following steps and fixes should sort out any of the problems mentioned above.
Fixing this error may require some patience. It's best to start with the simple fixes, which often solve the problem, but if they don't, you have other options. Here are the approaches to try.
1. Restart and try the installation again. This may seem counterintuitive to redo the thing that didn't work, but sometimes a restart is all your Mac needs to sort itself out.
2. Check the Date & Time setting. If the displayed date and time don't match reality, this could be the problem. Restart your Mac again if necessary, then go to System Settings > Date & Time and enable "Set time and date automatically" setting. After this, try the installation again to see if it works.
3. Free up space. In some cases, macOS fails to install because there isn't enough room on the hard drive. To see how much is available, click the Apple logo and select About This Mac, click More Info, scroll down and click Storage Settings. You'll see a breakdown of what's living on your computer. If the available space seems low, move some nonessential files off temporarily to see if that lets the installation proceed.
4. Reset the NVRAM (https://support.apple.com/en-gb/HT204063). This tiny chunk of memory stores basic information such as the time, monitor resolution, and which disk to start up from. You may need to go back into System Settings to switch any settings this changed, but you can try the installation again before that to make sure the problem is resolved.
5. Restore from a backup. If you use Time Machine to regularly back up your Mac, you can go back to an earlier state using Recovery Mode to see if it's more compatible with the installer.
6. Run Disk First Aid (launch Disk Utility located in /Applications/Utilities). This may help if you're getting the "Unable to mount volume" error. First Aid checks the internal hard drive and makes any fixes it can. It may even be able to mount the volume after it's done. Then you can retry the installation.
If none of the above worked, it may be time to turn your computer over to the professionals.