Run windows update repair

Fix Windows Update errors by using the DISM or System Update Readiness tool

Original product version: В Windows 10, version 1809 and later versions, Windows 8.1, Windows Server 2012 R2, Windows 7 Service Pack 1, Windows Server 2008 R2 Service Pack 1
Original KB number: В 947821

Symptom

Windows updates and service packs may fail to install if there are corruption errors. For example, an update might not install if a system file is damaged. The DISM or System Update Readiness tool may help you to fix some Windows corruption errors.

This article is intended for Support agents and IT professionals. If you are home users and looking for more information about fixing Windows update errors, see Fix Windows Update errors.

Resolution for Windows 8.1, Windows 10 and Windows Server 2012 R2

To resolve this problem, use the inbox Deployment Image Servicing and Management (DISM) tool. Then, install the Windows update or service pack again.

Open an elevated command prompt. To do this, open Start menu or Start screen, type Command Prompt, right-select Command Prompt, and then select Run as administrator. If you are prompted for an administrator password or for a confirmation, type the password, or select Allow.

Type the following command, and then press Enter. It may take several minutes for the command operation to be completed.

When you run this command, DISM uses Windows Update to provide the files that are required to fix corruptions. However, if your Windows Update client is already broken, use a running Windows installation as the repair source, or use a Windows side-by-side folder from a network share or from a removable media, such as the Windows DVD, as the source of the files. To do this, run the following command instead:

Replace the C:\RepairSource\Windows placeholder with the location of your repair source. For more information about using the DISM tool to repair Windows, reference Repair a Windows Image.

Type the sfc /scannow command and press Enter. It may take several minutes for the command operation to be completed.

Close the command prompt, and then run Windows Update again.

DISM creates a log file (%windir%/Logs/CBS/CBS.log) that captures any issues that the tool found or fixed. %windir% is the folder in which Windows is installed. For example, the %windir% folder is C:\Windows.

Resolution for Windows 7 Service Pack 1 (SP1) and Windows Server 2008 R2 SP1

To resolve this problem, use the System Update Readiness tool. Then, install the Windows update or service pack again.

Download the System Update Readiness tool.

select the download link in the following table that corresponds to the version of Windows that is running on your computer. For more information about how to find the version of Windows that you installed, see Find out if your computer is running the 32-bit or 64-bit version of Windows.

This tool is updated regularly, we recommend that you always download the latest version. This tool is not available in every supported language. Check the link below to see if it is available in your language.

Operating system Download link
x86-based (32-bit) versions of Windows 7 SP1 Download the package now.
x64-based (64-bit) versions of Windows 7 SP1 Download the package now.
x64-based (64-bit) versions of Windows Server 2008 R2 SP1 Download the package now.
Itanium-based versions of Windows Server 2008 R2 SP1 Download the package now.

Install and run the tool.

Select Download on the Download Center webpage, then do one of the following:

  • To install the tool immediately, select Open or Run, and then follow the instructions on your screen.
  • To install the tool later, select Save, and then download the installation file to your computer. When you’re ready to install the tool, double-select the file.

In the Windows Update Standalone Installer dialog box, select Yes.

When the tool is being installed, it automatically runs. Although it typically takes less than 15 minutes to run, it might take much longer on some computers. Even if the progress bar seems to stop, the scan is still running, so don’t select Cancel.

When you see Installation complete, select Close.

Reinstall the update or service pack you were trying to install previously.

To manually fix corruption errors that the tool detects but can’t be fixed, see How to fix errors that are found in the CheckSUR log file.

Resolution — Download the package from Microsoft Update Catalog directly

You can also try to directly download the update package from Microsoft Update Catalog, and then install the update package manually.

For example, you may have problems when you try to install updates from Windows Update. In this situation, you can download the update package and try to install the update manually. To do this, follow these steps:

Open Microsoft Update Catalog in Internet Explorer.

In the search box, input the update number that you want to download. In this example, input 3006137. Then, select Search.

Find the update that applies to your operating system appropriately in the search results, and then select Add to add the update to your basket.

Select view basket to open your basket.

Select Download to download the update in your basket.

Select Browse to choose a location for the update you are downloading, and then select Continue.

Select Close after the download process is done. Then, you can find a folder that contains the update package in the location that you specified.

Open the folder, and then double-select the update package to install the update.

If the Windows update or service pack installed successfully, you are finished. If the problem is not fixed, or if System Update Readiness Tool cannot find the cause, contact us for more help.

Description of the common corruption errors

The following table lists the possible error code with Windows Update for your reference:

Code Error Description
0x80070002 ERROR_FILE_NOT_FOUND The system cannot find the file specified.
0x8007000D ERROR_INVALID_DATA The data is invalid.
0x800F081F CBS_E_SOURCE_MISSING The source for the package or file not found.
0x80073712 ERROR_SXS_COMPONENT_STORE_CORRUPT The component store is in an inconsistent state.
0x800736CC ERROR_SXS_FILE_HASH_MISMATCH A component’s file does not match the verification information present in the component manifest.
0x800705B9 ERROR_XML_PARSE_ERROR Unable to parse the requested XML data.
0x80070246 ERROR_ILLEGAL_CHARACTER An invalid character was encountered.
0x8007370D ERROR_SXS_IDENTITY_PARSE_ERROR An identity string is malformed.
0x8007370B ERROR_SXS_INVALID_IDENTITY_ATTRIBUTE_NAME The name of an attribute in an identity is not within the valid range.
0x8007370A ERROR_SXS_INVALID_IDENTITY_ATTRIBUTE_VALUE The value of an attribute in an identity is not within the valid range.
0x80070057 ERROR_INVALID_PARAMETER The parameter is incorrect.
0x800B0100 TRUST_E_NOSIGNATURE No signature was present in the subject.
0x80092003 CRYPT_E_FILE_ERROR An error occurred while Windows Update reads or writes to a file.
0x800B0101 CERT_E_EXPIRED A required certificate is not within its validity period when verifying against the current system clock or the time stamp in the signed file.
0x8007371B ERROR_SXS_TRANSACTION_CLOSURE_INCOMPLETE One or more required members of the transaction are not present.
0x80070490 ERROR_NOT_FOUND Windows could not search for new updates.
0x800f0984 PSFX_E_MATCHING_BINARY_MISSING Matching component directory exist but binary missing
0x800f0986 PSFX_E_APPLY_FORWARD_DELTA_FAILED Applying forward delta failed
0x800f0982 PSFX_E_MATCHING_COMPONENT_NOT_FOUND Can’t identify matching component for hydration

What does the System Update Readiness tool do

Verify the integrity of resources

The System Update Readiness tool verifies the integrity of the following resources:

  • Files that are located in the following directories:
    • %SYSTEMROOT%\Servicing\Packages
    • %SYSTEMROOT%\WinSxS\Manifests
  • Registry data that is located under the following registry subkeys:
    • HKEY_LOCAL_MACHINE\Components
    • HKEY_LOCAL_MACHINE\Schema
    • HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing

This list may be updated at any time.

When the System Update Readiness tool detects incorrect manifests, Cabinets, or registry data, it may replace the incorrect data with a corrected version.

Logging

The System Update Readiness tool creates a log file that captures any issues that the tool found or fixed. The log file is located here:

How to fix errors that are found in the CheckSUR log file

To manually fix corruption errors that the System Update Readiness tool detects but can’t fix, follow these steps:

%SYSTEMROOT% is an environment variable that saves the folder in which Windows is installed. For example, generally the %SYSTEMROOT% folder is C:\Windows.

Identify the packages that the tool can’t fix. For example, you may find the following in the log file:

In this case, the package that is corrupted is KB958690.

Copy the package (.msu) to the %SYSTEMROOT%\CheckSUR\packages directory. By default, this directory doesn’t exist and you need to create the directory.

Сброс настроек службы обновлений Windows Update

В этой статье мы покажем, как исправить ошибки и восстановить работу службы обновления Windows с помощью сброса конфигурации агента и службы Windows Update. Как правило, это самый эффективный и простой способ решить проблему с работой службы обновлений Windows, если обновления не загружаются или происходят ошибки при установке обновлений.

Обычно для отладки и дебага ошибок службы обновления Windows администратору необходимо проанализировать коды ошибок в файле журнала обновлений %windir%\WindowsUpdate.log (в Windows 10 получить файл WindowsUpdate.log можно таким способом). Количество возможных ошибок, с которыми может столкнуться администратор при анализе журнала обновлений исчисляется десятками (список всех ошибок Windows Update) и процесс их разрешения в основном нетривиальный. В некоторых случаях вместо детального анализа ошибок Windows Update гораздо быстрее и проще сначала произвести полный сброс настроек агента и службы Windows Update. После сброса Windows Update вы можете выполнить сканирование и поиск обновлений.

Средство устранения неполадок Центра обновления Windows

Прежде чем перейти к сбросу конфигурации центра обновления Windows настоятельно рекомендуем сначала попробовать более простое и эффективное средство для автоматического исправления проблем в службе обновления Windows – средство устранения неполадок Центра обновления Windows (Windows Update Troubleshooter).

Скачайте и запустите Windows Update Troubleshooter для вашей версии Windows:

  • Windows10 – wu10.diagcab ( https://aka.ms/wudiag ) (либо запустите локальную версию инструмента: Пуск -> Параметры -> Обновления и безопасность -> Устранение неполадок -> Центр обновлений Windows (Start -> Settings -> Updates and Security -> Troubleshoot -> Windows Updates Troubleshooter);
  • Windows 7и Windows 8.1 — WindowsUpdate.diagcab ( https://aka.ms/diag_wu ).

Дождитесь пока средство устранения неполадок Центра обновления Windows просканирует систему и попытается автоматически исправить все ошибки в службе Windows Update и связанных компонентах.

В моем случае была обнаружена и исправлена потенциальная ошибка в базе данных Центра обновления Windows. После этого осталось перезагрузить компьютер и попробовать выполнить поиск обновлений. Если обновления не загружаются или не устанавливаются, перейдите к следующему этапу.

Сброс настроек Windows Update из командной строки

Процесс сброса настроек агента и службы обновления Windows состоит из нескольких этапов. Все описанные операции выполняются в командной строке и собраны в один bat файл (готовый скрипт можно скачать по ссылке ниже).

С помощью данного скрипта можно полностью сбросить конфигурацию службы Центра обновлений Windows, и очистить локальный кэш обновлений. Скрипт является универсальный и будет работать как в Windows 7, Windows 8.1 и Windows 10, так и в Windows Server 2016/ 2012 R2/ 2008 R2. Скрипт помогает устранить большинство типовых ошибок в работе службы Windows Update, когда центр обновлений перестает загружать новые обновления или пишет, что при установке обновления возникают ошибки.

Итак, по порядку о том, что делает скрип:

  1. Остановка службы Windows Update (Центр обновлений Windows), BITS и службы криптографии:
    net stop bits
    net stop wuauserv
    net stop appidsvc
    net stop cryptsvc
    taskkill /im wuauclt.exe /f
  2. Удаление служебных файлов qmgr*.dat в каталоге %ALLUSERSPROFILE%\Application Data\Microsoft\Network\Downloader\:
    Del «%ALLUSERSPROFILE%\Application Data\Microsoft\Network\Downloader\qmgr*.dat»
  3. Переименовываем служебные каталоги, в которых хранятся конфигурационные файлы и кэш обновлений (в случае необходимости их можно будет использовать как резервные копии). После перезапуска службы обновления, эти каталоги автоматически пересоздадутся:
    Ren %systemroot%\SoftwareDistribution SoftwareDistribution.bak
    Ren %systemroot%\system32\catroot2 catroot2.bak
  4. Удаление старого журнала windowsupdate.log
    del /f /s /q %windir%\windowsupdate.log
  5. Сброс разрешений на службы BITS и Windows Update (в случае, если права на службы были изменены)
    sc.exe sdset bits D:(A;;CCLCSWRPWPDTLOCRRC;;;SY) (A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA) (A;;CCLCSWLOCRRC;;;AU) (A;;CCLCSWRPWPDTLOCRRC;;;PU)
    sc.exe sdset wuauserv D:(A;;CCLCSWRPWPDTLOCRRC;;;SY) (A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA) (A;;CCLCSWLOCRRC;;;AU) (A;;CCLCSWRPWPDTLOCRRC;;;PU)
    sc.exe sdset cryptsvc D:(A;;CCLCSWLOCRRC;;;AU)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCDCLCSWRPWPDTLCRSDRCWDWO;;;SO)(A;;CCLCSWRPWPDTLOCRRC;;;SY)S:(AU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;WD)
    sc.exe sdset trustedinstaller D:(A;;CCLCSWLOCRRC;;;AU)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCDCLCSWRPWPDTLCRSDRCWDWO;;;SO)(A;;CCLCSWRPWPDTLOCRRC;;;SY)S:(AU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;WD)
  6. Перерегистрация файлов системных динамических библиотек (dll), связанных со службами BITS и Windows Update:
    cd /d %windir%\system32
    regsvr32.exe /U /s vbscript.dll
    regsvr32.exe /U /s mshtml.dll
    regsvr32.exe /U /s msjava.dll
    regsvr32.exe /U /s msxml.dll
    regsvr32.exe /U /s actxprxy.dll
    regsvr32.exe /U /s shdocvw.dll
    regsvr32.exe /U /s Mssip32.dll
    regsvr32.exe /U /s wintrust.dll
    regsvr32.exe /U /s initpki.dll
    regsvr32.exe /U /s dssenh.dll
    regsvr32.exe /U /s rsaenh.dll
    regsvr32.exe /U /s gpkcsp.dll
    regsvr32.exe /U /s sccbase.dll
    regsvr32.exe /U /s slbcsp.dll
    regsvr32.exe /U /s cryptdlg.dll
    regsvr32.exe /U /s Urlmon.dll
    regsvr32.exe /U /s Oleaut32.dll
    regsvr32.exe /U /s msxml2.dll
    regsvr32.exe /U /s Browseui.dll
    regsvr32.exe /U /s shell32.dll
    regsvr32.exe /U /s atl.dll
    regsvr32.exe /U /s jscript.dll
    regsvr32.exe /U /s msxml3.dll
    regsvr32.exe /U /s softpub.dll
    regsvr32.exe /U /s wuapi.dll
    regsvr32.exe /U /s wuaueng.dll
    regsvr32.exe /U /s wuaueng1.dll
    regsvr32.exe /U /s wucltui.dll
    regsvr32.exe /U /s wups.dll
    regsvr32.exe /U /s wups2.dll
    regsvr32.exe /U /s wuweb.dll
    regsvr32.exe /U /s scrrun.dll
    regsvr32.exe /U /s msxml6.dll
    regsvr32.exe /U /s ole32.dll
    regsvr32.exe /U /s qmgr.dll
    regsvr32.exe /U /s qmgrprxy.dll
    regsvr32.exe /U /s wucltux.dll
    regsvr32.exe /U /s muweb.dll
    regsvr32.exe /U /s wuwebv.dll

    regsvr32.exe /s vbscript.dll
    regsvr32.exe /s mshtml.dll
    regsvr32.exe /s msjava.dll
    regsvr32.exe /s msxml.dll
    regsvr32.exe /s actxprxy.dll
    regsvr32.exe /s shdocvw.dll
    regsvr32.exe /s Mssip32.dll
    regsvr32.exe /s wintrust.dll
    regsvr32.exe /s initpki.dll
    regsvr32.exe /s dssenh.dll
    regsvr32.exe /s rsaenh.dll
    regsvr32.exe /s gpkcsp.dll
    regsvr32.exe /s sccbase.dll
    regsvr32.exe /s slbcsp.dll
    regsvr32.exe /s cryptdlg.dll
    regsvr32.exe /s Urlmon.dll
    regsvr32.exe /s Oleaut32.dll
    regsvr32.exe /s msxml2.dll
    regsvr32.exe /s Browseui.dll
    regsvr32.exe /s shell32.dll
    regsvr32.exe /s Mssip32.dll
    regsvr32.exe /s atl.dll
    regsvr32.exe /s jscript.dll
    regsvr32.exe /s msxml3.dll
    regsvr32.exe /s softpub.dll
    regsvr32.exe /s wuapi.dll
    regsvr32.exe /s wuaueng.dll
    regsvr32.exe /s wuaueng1.dll
    regsvr32.exe /s wucltui.dll
    regsvr32.exe /s wups.dll
    regsvr32.exe /s wups2.dll
    regsvr32.exe /s wuweb.dll
    regsvr32.exe /s scrrun.dll
    regsvr32.exe /s msxml6.dll
    regsvr32.exe /s ole32.dll
    regsvr32.exe /s qmgr.dll
    regsvr32.exe /s qmgrprxy.dll
    regsvr32.exe /s wucltux.dll
    regsvr32.exe /s muweb.dll
    regsvr32.exe /s wuwebv.dll

  7. Сброс параметров Winsock netsh winsock reset
  8. Сброс параметров системного прокси netsh winhttp reset proxy
  9. Опционально. При использовании локального сервера WSUS, возможно дополнительно сбросить текущую привязку клиента к серверу WSUS путем удаления следующих параметров в ветке HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate:
    REG DELETE «HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate» /v AccountDomainSid /f
    REG DELETE «HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate» /v PingID /f
    REG DELETE «HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate» /v SusClientId /f
    REG DELETE «HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate» /v TargetGroup /f
    REG DELETE «HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate» /v WUServer /f
    REG DELETE «HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate» /v WUStatusServer /f
  10. Запуск остановленных служб:

    sc.exe config wuauserv start= auto
    sc.exe config bits start= delayed-auto
    sc.exe config cryptsvc start= auto
    sc.exe config TrustedInstaller start= demand
    sc.exe config DcomLaunch start= auto
    net start bits
    net start wuauserv
    net start appidsvc
    net start cryptsvc

  11. Опционально. В некоторых случая требуется установить/переустановить последнюю версию агента Windows Update Agent (WUA). Скачать актуальную версию агента можно со страницы https://support.microsoft.com/en-us/kb/949104. Нужно скачать файл для вашей версии Windows.Актуальная версия агента WUA для Windows 7 SP1 x64 — 7.6. Принудительная переустановка агента WindowsUpdate выполняется следующими командами:
    • для Windows 7 x86: WindowsUpdateAgent-7.6-x86.exe /quiet /norestart /wuforce
    • для Windows 7 x64: WindowsUpdateAgent-7.6-x64.exe /quiet /norestart /wuforce

Осталось перезагрузить компьютер и запустить синхронизацию с сервером Windows Update /WSUS.

wuauclt /resetauthorization /detectnow

Затем зайдите в Центр обновления и проверьте, пропали ли проблемы при поиске, скачивании и установке обновлений.

Сам скрипт reset_win_update.bat можно скачать по ссылке reset_win_update.zip (пункты 9 и 11 в скрипте не выполняются, т.к. являются опциональными). Скрипт нужно скачать, распаковать и запустить с правами администратора.

После этого перезагрузите компьютер, затем зайдите в Центр обновлений и проверьте, пропали ли проблемы при поиске, скачивании и установке обновлений.

Если обновления начали корректно скачиваться и устанавливается, можно удалить папки резервные копии папок:

Ren %systemroot%\SoftwareDistribution SoftwareDistribution.bak
Ren %systemroot%\system32\catroot2 catroot2.bak

Скрипт Reset Windows Update Agent

В галерее скриптов Technet есть довольно полезный и простой скрипт для сброса компонентов центра обновлений — Reset Windows Update Agent. Скрипт универсальный и подходит для всех версий Windows: начиная с Windows XP и заканчивая последними версиями Windows 10. Рассмотрим, как им пользоваться.

  1. Скачайте архив ResetWUEng.zip здесь (https://gallery.technet.microsoft.com/scriptcenter/Reset-Windows-Update-Agent-d824badc) и распакуйте его;
  2. Запустите файл ResetWUEng.cmd с правами администратора;
  3. Скрипт определит вашу версию ОС (в моем примере это Windows 10) и предложит 18 различных опций. Некоторые из них напрямую не относятся к сбросу настроек агента WU, но могут быть полезны для исправления различных неисправностей в Windows (проверка диска chkdsk, исправление ошибок в образе Windows, сброс Winsock, очистка временных файлов и т.д.);
  4. Для сброса настроек Windows Update как правило достаточно использовать опцию 2 —ResetstheWindowsUpdateComponents (Сбросить компоненты службы обновления Windows). Нажмите 2 и Enter;
  5. Скрипт автоматически выполнит все действия, которые мы описали выше при выполнении ручного сброса агента обновлений Windows из командной строки.

Читайте также:  Complete linux kali linux
Оцените статью