Access denied (0x80070005)

Windows or a program has no permission to change a file: often an antivirus, a broken update folder or a wrong user account.

How to fix it

  1. Run the Windows Update troubleshooter: Settings > System > Troubleshoot > Other troubleshooters > Windows Update.
  2. Turn off or uninstall third-party antivirus for a moment (Windows Security stays on), then try again.
  3. Reset Windows Update: in Terminal (Admin) run net stop wuauserv and net stop bits , rename C:\Windows\SoftwareDistribution to SoftwareDistribution.old, then net start wuauserv and net start bits .
  4. Repair Windows files: open Terminal (Admin) and run DISM /Online /Cleanup-Image /RestoreHealth then sfc /scannow and restart.