Cannot reinstall macOS on corrupted drive The other day I accidentally messed up updating my iMac from 2010 and have seemed to uninstall macOS.
I have successfully made a usb boot drive for Sierra (the os it was on prior to this problem), but when I open Utilities in recovery mode and click install macOS, I get a “The operation couldn’t be completed. Permission denied” error.
I would try and go into internet recovery mode but unfortunately that feature doesn’t work on Macs this old. I would also try to just reformat my hard drive but I need all the data on it. What can I do?
This question is one we get often. If your Mac can’t boot itself to internet recovery, you need to bring a bootable external OS to your Mac to fix it.
Your Mac could run in target mode and you download the installer from another Mac or use another Mac or person to make you a new installer.
Apple documents these steps very well. All you have to do is choose what OS you want to reinstall over your existing to see if the data is still intact or if you just want to erase and set up new.

https://support.apple.com/en-us/HT204267

You will have to know how to examine the install logs or make a second installer. Either your drive is broken and needs erase and repair or your installer is broken. Hard to tell without hands on and experience. It’s easy to repeat the install with a known good installer. Then the chances both installers fail is low and you’ll know your Mac needs extra steps and attention.

https://support.apple.com/en-us/HT210905 (has steps to repair a disk)
https://support.apple.com/en-us/HT204904 (has steps to erase the disk and reinstall)