Home » How To » Fix ‘Failed in attempting to update the source: winget’ Error

Fix ‘Failed in attempting to update the source: winget’ Error

Though not often, you might see the “Failed in attempting to update the source: winget” error from time to time while using winget to search, install, or uninstall applications on Windows.

This error, though not fatal, is one of the most common winget issues on Windows. Basically, the error is saying that winget failed to update a source called ‘winget.’ Not updating the source can stop you from updating existing applications or searching & installing new applications.

Failed in attempting to update the source: winget error

This guide shows you how to rectify and fix the ‘Failed in attempting to update the source: winget’ error on Windows.

Table of contents:

  1. Reasons for ‘Failed in attempting to update the source: winget’ error
  2. How to fix the ‘Failed in attempting to update the source: winget’ error
    1. Reboot the computer
    2. Check your internet connection
    3. Reset winget
    4. Update winget sources
    5. Run chkdsk
    6. Run the DISM command
    7. Reinstall winget
  3. Conclusion

Reasons for ‘Failed in attempting to update the source: winget’ error

There are several reasons why you might see the ‘Failed in attempting to update the source: winget’ error while using winget. Some of them include but are not limited to:

  1. Microsoft CDN issues: Winget updates its sources from Microsoft. If Microsoft CDN has problems or is down for some reason, winget cannot update its sources and show the ‘Failed in attempting to update the source: winget’ error. Since this issue is out of your control, you have to wait until the Microsoft CDN is back up and running.
  2. Corrupted winget files: If the system crashes or shutdown unexpectedly while running winget, it might corrupt important winget files, especially the winget source files. In those cases, winget will show the failure to update the source error.
  3. Using winget management applications: If you are using winget management applications, like wingetUI, there is a chance that it can mess with winget files causing the error. This is especially true if you uninstalled the winget management application.
  4. Outdated winget sources: If the winget sources are obsolete, winget might show the failure to update the source error. In that case, you have to force update winget sources.

How to fix the ‘Failed in attempting to update the source: winget’ error

Since there is no one specific reason why winget shows this error, follow the steps below one by one to fix the ‘Failed in attempting to update the source: winget’ error.

1. Reboot the computer

The first and foremost thing you should do is restart Windows.

Often, winget might fail to update the sources just because some other application is interfering or the files are locked. Restarting will solve these issues, which will, in turn, allow winget to update the source as needed.

Once the sources are updated, winget will no longer show the ‘Failed in attempting to update the source: winget’ error.

2. Check your internet connection

Make sure you have a stable and reliable internet connection and that your ISP is not blocking traffic to certain sites or having DNS resolution issues. For instance, if your ISP is having problems with its DNS server, it might block winget from connecting to the update source. In those cases, you will see the ‘Failed in attempting to update the source: winget’ error.

To fix it, make sure you have a reliable internet connection. To check and fix any internet connection issues, run the Internet Connections troubleshooter by going to the “System -> Troubleshoot -> Other troubleshooters” page in the Settings app (Windows key + I).

run internet connection troubleshooter

You can also try clearing the DNS cache, changing the DNS of your computer, and enabling DNS over HTTPS. If your ISP’s DNS server is the issue, changing the DNS to a reputable and reliable server like Google Public DNS or Cloudflare will fix the issue.

Note: To make things easier, I recommend using DNS changer software. It makes it easy to switch between DNS services with just a few clicks.

On the other hand, if the issue is with that Microsoft CDN service, to which winget connects to update, there is nothing you can do other than wait for the CDN to be back up and running.

3. Reset winget

When there are problems with winget, you can force reset it. Resetting winget will clear the cache and reset important files and configuration, solving the ‘Failed in attempting to update the source: winget’ issue. Let me show you how to reset winget on Windows.

Reset winget via the Settings app:

  1. Open the Settings app with the “Windows key + I” shortcut.
  2. Click “Apps” on the sidebar.
  3. Go to the “Installed apps” page.
  4. Find the “Windows Package Manager Source (winget)” app.
  5. Click the “Menu” icon (…) next to it.
  6. Select the “Advanced options” option.
  7. Click the “Reset” button twice.
  8. With that, you are done with resetting winget.

Reset winget via command line (source reset):

  1. Right-click on the Start menu.
  2. Select the “Terminal (Admin)” option.
  3. Run the “winget source reset –force” command.
  4. Close the terminal window.
  5. With that, you are done with resetting winget.
reset winget to fix Failed in attempting to update the source: winget error

4. Update winget sources

Sometimes outdated sources can cause the ‘Failed in attempting to update the source: winget’ error. In that case, updating all winget sources will fix the problem.

Here’s how to update winget sources:

  1. Right-click on the Start menu.
  2. Select the “Terminal (Admin)” option.
  3. Run the “winget source update” command.
  4. It will update all winget sources.
  5. With that, you are done with updating winget sources.
update winget source

Once all the sources are updated, you will no longer see the error.

5. Run chkdsk

If there are disk errors, it can be a primary reason for the winget error. In that case, running the chkdsk scan will be helpful. If you don’t know, chkdsk is a built-in scanning and repair tool to fix hard disk errors.

I’ve already written a detailed guide on how to schedule a chkdsk scan on the next restart and various chkdsk commands. So, follow the linked guide, and it should hopefully fix the winget problem.

schedule chkdsk

6. Run the DISM command

If your system crashed or shutdown unexpectedly, there is a chance that some of your system files are corrupted. If those system files are responsible for the functioning of winget, it might show the ‘Failed in attempting to update the source: winget’ error.

In those cases, running the DISM command allows you to fix or restore those missing or corrupted system files, which in turn fixes the winget problem.

Here’s how to run the DISM command to restore missing or corrupted system files:

  1. Right-click on the Start menu.
  2. Select the “Terminal (Admin)” option.
  3. Run the below command and press Enter.
    DISM /Online /Cleanup-Image /RestoreHealth
  4. Wait for the command to fix the problems.
  5. Close the terminal window.
  6. Reboot Windows.
  7. With that, the winget problem should now be fixed.
DISM RestoreHealth command

7. Reinstall winget

When everything fails, you can just reinstall winget. No matter the error, reinstalling winget fixes all kinds of issues. The only downside is that if you configured winget in a specific way, you might have to reconfigure it.

Here’s how to reinstall winget on Windows:

  1. Go to the winget GitHub page.
  2. Download the latest “Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle” package.
  3. Double-click on the downloaded file.
  4. Click the “Re-install” button when prompted.
  5. Reboot the computer after installation.
  6. Right-click on the Start menu.
  7. Select the “Terminal (Admin)” option.
  8. Run the “winget source update” command.
  9. This will update all the sources.
  10. With that, the winget error is fixed.

winget-cli GitHub link: https://github.com/microsoft/winget-cli/releases/

Conclusion

As you can see, though the ‘Failed in attempting to update the source: winget’ error is pretty cryptic, and there are several reasons for it, like the Microsoft CDN issues, outdated winget sources, corrupted winget files, etc., it is rather easy to fix. By following the steps outlined in this guide, you can quickly get rid of the error and continue to use winget to search, install, or uninstall applications on Windows without issues.

I hope this simple and easy Windows how-to guide helped you.

If you are stuck or need help, email me, and I will try to help as much as possible.

1 thought on “Fix ‘Failed in attempting to update the source: winget’ Error”

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top