2019-01-15

Solution - Windows Update Can't check for Updates, Update hangs

Problem - Windows Can't check for Updates; Update hangs. 

This article fixes a variety of Windows 11 and 10 update ills.  

Steps are comprehensive, compiled from multiple sources and tested by the author on dozens of computers.  Although the steps are numerous and geeky, they are almost guaranteed to fix all kinds of Windows Update problems.

Updated for Windows 11
Windows 7 steps removed due to age.


Symptoms:
Windows update System Tray icon reports "Windows can't check for updates"
Windows Update hangs for hours at 0%, 44%, 90% and other percentages
Windows update "Checking for updates" status bar / progress bar does not move
The Windows Update Status indicator runs, but shows no activity or
The Windows Update Control Panel Page shows a Red-shield icon and warns you should run an update regularly, but it does not actually run the update.
Windows Cumulative Update hangs at Initializing



Reason:
Windows Update may be corrupted.  Corruption can especially happen if an older computer is brought online after a long time without updates.


You can run these steps even if you are not sure the symptoms match your problem.  There is no harm, other than taking the time.

These steps resolved the problem on my computer, but expect
to take several hours to run diagnostics -- plus more time 
to catch-up on the Windows updates. 

Windows Update can be found in "Settings" (the Gear icon).  Or click the start menu and immediately type "Update" ("check for updates").


Important Prerequisites for Windows 11 and 10:

A.  If you have not already done so, or done recently, reboot the PC.

Reason:  Sometimes Windows update needs to update itself before it can update other things and this often requires a reboot.  You may see "Windows updating..."  This is good.  This is an issue if the PC seldom reboots.

B.  After the reboot, wait 5 minutes, then check the Windows Update status again.  If pending updates, give it  (20 or 30  60 minutes) to see if the status or percent-status changes.  If it starts changing, let the update complete.  Let the machine sit for a while.

Some updates are slow updating the status and can sit at "initializing" for an hour or more before it began changing the downloading percentage.  


If the PC goes to sleep, the install may not finish.  This seems to be a particular problem with laptops, which often have tight power-management policies. For big updates, consider turning off the computer's power-saving features (turn off computer after xx minutes inactivity...)  see Windows Settings, Power Savings.

C.  If still hung, or you find you keep oscillating between downloading and initializing, continue with these steps.

D.  Although rare, confirm the PC's Date and Time are correct.  (Click the time in the lower-right System Tray).  Windows update panics if this is too-far out-of-sync.

Windows 11, Windows 10
---------------------------------

1.  Click the Gear Icon, Settings,

Choose "Trouble Shoot", "Advanced Troublehooters". 
Click "Windows Update".

Allow the troubleshooter to run.


2.  When the Troubleshooter completes:

If all is well, and problems report as 'fixed,' reboot and retry Windows Update (See Gear-icon, Windows Update). 

If updates still hang (likely, because I have never seen the trouble shooter being helpful), continue with the manual steps.  If Windows Update Troubleshooter reports errors that could not be resolved, reboot, and continue with the next Manual steps.


Manual Steps:

A.  For best results, especially on older computers and laptops, turn off Windows Power Saving features (run full power; do not turn off disk after inactivity, etc.).  For laptops, use wall power rather than the battery.  Make these temporary changes:

See Gear-icon (Settings), Power and Sleep.
Set "When plugged in, turn off: Never"
Set "When plugged in, Sleep: Never


B.  Lunch an adminstrative (elevated) DOS CMD Prompt:

Click the Windows start menu, and immediately begin typing the word  "CMD"
Single-click the found "Command Prompt" icon (do not launch or open)

Other-mouse-click the "Command Prompt" icon,
choose "Run as Administrator" (or More, Run as Administrator).  
DOS runs as an "elevated command."


C.  At the Administrative Command prompt, type these commands, one-at-at-time, pressing enter after each.  Services are being stopped to free file-locks on the software distribution folders.

net stop wuauserv   "Service not started" messages are normal, esp Windows Home
net stop cryptSvc   Keep track of which were actually stopped
net stop bits
net stop msiserver


D.  Rename these folders:

Still at the elevated command prompt, 

Rename C:\Windows\SoftwareDistribution SoftwareDistribution2.old
Rename C:\Windows\System32\catroot2 Catroot2.old

If rename folders fail, try File Explorer and delete the offending folder.  The CatRoot2 is obstinate and may not allow changes.  Consider rebooting into Windows Safe Mode and stopping the services, etc., *or* I have had success in skipping this step. 


E.  Once renamed,

net start wuauserv 
(start only if stopped above)
net start cryptSvc
net start bits     
(only if stopped above)
net start msiserver
(only if stopped above)


F.  At the same Administrator's DOS prompt, type this command, pressing Enter after typing. 
You must be running in Administrator mode!


DISM.exe /Online /Cleanup-image /Scanhealth

/ScanHealth will have hesitations while running and may take several minutes before displaying an ASCII  [0%---100%] status bar.  Expect a total run-time of 30 minutes or so.

Important:  Wait for "operation completed successfully".
Caution:  Once started, do not interrupt or cancel .

If it finds a problem, /ScanHealth step will report something along the lines, 'Repair possible'
If all is well, it will report "No component store corruption". 

In either case, continue with the next step.


G.  Next, at the same elevated Command-prompt, type this DOS command:

DISM.exe /Online /Cleanup-image /RestoreHealth


Again, expect delays, no screen activity, and an ASCII status bar. 
Another fifteen minutes or so... 
Look for "The operation completed successfully"


H.  Finally, from the same administrative DOS prompt, type this command, which does another series of cache repairs:

sfc /scannow

Again, expect about fifteen minutes to a half-hour. 

If errors ("Windows Resource Protection found corrupt files but was unable to fix some of them"):  Ignore and do not worry - these are obscure and likely not germane to this article.  The offered log file (notepad C:\windows\logs\cbs\cbs.log) is thousands of lines long - who has time to read that?


I.  When done, close the DOS Command Prompt window, "X", or type "exit"

J.  You must Reboot

On reboot, Windows, and Windows Update may apply updates.

In my experience, these steps have fixed almost all Windows Update programs.
Your comments are welcome.


Final Testing:

Open the Windows (Gear) "Settings" menu
Launch "Check for Updates".
Hopefully, all updates will apply. 

Some updates, such as Windows Cumulative Updates, are slow at telling you their progress -- sitting at "initializing" or "0%" for long times.  Give the computer time.  If it seems really hung, and after a respectable delay (say an hour), reboot and check again.  This often fixes recalcitrant updates.


Cleanup:

A.  After all updates have applied, return Power Savings settings to your preferred values:

See Gear-icon (Settings), Power and Sleep.
Set "When plugged in, turn off: (1 hr)
"Set "When plugged in, Sleep: (30 min)


B.  The two renamed folders can be deleted.

C:\Windows\SoftwareDistribution2.old
C:\Windows\System32\Catroot2.old



Comments:
I see this problem particularly when the workstation has been off the network for a long time or if Windows Update is set to manual and has not run in a long time. 

For example, with a laptop, I restored an image from 2 years ago, after pulling the machine out of moth-balls.  I found Windows Update hung multiple times and required 7 different reboots, as it applied 1.7G of patches and finally caught-up.

I have seen other articles on the Net, suggesting flushing cache, registry hacks, disk-repairs, and scan disks.  That all has been nonsense.  The key: Wait.  Leave the machine running for a few hours.  A quiet reboot after waiting has worked for me on several different machines. If those fail, try these steps.


1 comment:

  1. A reader had a Windows 11 Microsoft KB Update that remained "hung" -- even with these steps. He had two issues.

    The first, he could not do one of the Rename steps. The folder had a file-lock. Stopped services did not release the lock. It could be because he was running Windows 11 Professional and it may behave differently.

    In any case, the rename is critical to the problem, and he was unwilling to boot into Safe Mode to do the rename. Because of this, the KB-update continued to hang.

    The second problem was more interesting. The KB update that was failing was not in my list of KB's. Turns out, in his Windows Update Settings, he had "Get the Latest Updates as soon as they are available".

    While this is not Microsoft Beta code, it is mighty close -- experimental code for sure. He unchecked that, and I believe the update went away.

    ReplyDelete

Comments are moderated and published upon review. (As an aside, not a single spam has been allowed through; why bother?)