Symptoms: a Windows update downloads, then fails with error 0x800f0831 and tries again at the next restart.
The code usually means that a previous update or a required component is damaged or missing, so the new one cannot be applied.
1. The quick steps
- Free some disk space (see "How to free up disk space on Windows"). Windows needs at least 10 GB free.
- Restart the computer and try again.
- Open Settings → System → Troubleshoot → Other troubleshooters and run Windows Update.
2. Clear the update cache
Open Command Prompt as administrator and stop the update services:
net stop wuauserv
net stop bits
net stop cryptsvc
Then rename the cache folders. Renaming is safer than deleting, because Windows rebuilds them:
ren %windir%\SoftwareDistribution SoftwareDistribution.old
ren %windir%\System32\catroot2 catroot2.old
Start the services again and check for updates:
net start cryptsvc
net start bits
net start wuauserv
You can delete the .old folders after a few days when updates work.
3. Repair the system files
DISM /Online /Cleanup-Image /RestoreHealth
sfc /scannow
Run DISM first, then SFC, and restart afterwards (see "How to improve Windows performance with the built-in SFC and DISM commands").
4. Check .NET Framework
This error often points to a damaged .NET Framework 3.5. Open Control Panel → Programs → Turn Windows features on or off and make sure .NET Framework 3.5 is ticked, then try the update again.
5. Install the update by hand
Note the KB number of the update that fails (for example KB5034123), search it in the Microsoft Update Catalog, download the version for your Windows, and run it.
Still failing?
Open a ticket with your Windows version, the KB number and the error code.