sodcalculator

10 Tech How-To

How to Use Winget on Windows 11

Guide 10-37669 · Updated · Step by step

Winget (Windows Package Manager) is a command-line tool built into Windows 11 that lets you install, upgrade, and remove software from the official Microsoft Store and many popular publishers. Instead of visiting websites and running installers manually, you type one command and winget handles the download and setup. This guide walks you through the essential commands, from finding software to batch-updating everything, and covers the common pitfalls.

What You’ll Need

  • Windows 11 (winget is preinstalled on most recent versions; if not, update via the Microsoft Store).
  • An internet connection.
  • Administrator rights for some installs (the terminal will prompt you if needed).
  • Basic comfort with the Command Prompt, PowerShell, or Windows Terminal.

Step-by-Step

  1. Open a terminal. Press Win + X and select “Terminal” or “Windows Terminal”. You can also search for “cmd” or “PowerShell” in the Start menu. For most commands, a regular user window works; for system-wide installs, you may need to run as administrator (right-click the terminal icon and choose “Run as administrator”).
  2. Check that winget is available. Type winget --version and press Enter. If you see a version number (e.g., v1.7.10582), you’re ready. If you get “not recognized”, update Windows or install the App Installer from the Microsoft Store.
  3. Search for a package. Use winget search <keyword>. For example, winget search vlc returns a list of packages with their IDs, names, and sources. The ID is what you’ll use to install. If you see multiple results, pick the one from a trusted source (usually “winget” or “msstore”).
  4. Install a package. Run winget install <PackageID>. For instance, winget install VideoLAN.VLC. Winget downloads the installer and runs it silently (if the installer supports it). You may see a UAC prompt – click “Yes”.
  5. Install without confirmation. To skip the source agreement prompts, add --accept-package-agreements --accept-source-agreements. For example: winget install --id VideoLAN.VLC --accept-package-agreements --accept-source-agreements. This is useful for scripting.
  6. Update a single package. Use winget upgrade <PackageID> to update that app. For example, winget upgrade VideoLAN.VLC.
  7. Update all packages. Run winget upgrade --all. This checks every installed winget-managed app and updates them all. You can add --include-unknown to also update packages that don’t report a version, but be careful – that can cause issues.
  8. List installed packages. Use winget list to see everything winget manages. You can filter with a keyword: winget list <keyword>.
  9. Uninstall a package. Run winget uninstall <PackageID>. For example, winget uninstall VideoLAN.VLC. This triggers the uninstaller.
  10. Export and import your app list. To back up your setup, run winget export -o apps.json. To restore on a new machine, copy that file and run winget import -i apps.json. This is handy for reinstalling Windows.
  11. Use aliases for speed. Winget supports short aliases: winget install can be shortened to winget add, winget upgrade to winget update, and winget list to winget ls. These work in recent versions.

Common Mistakes

  • Using the app name instead of the ID. winget install "VLC media player" often fails because the exact name is not the ID. Always use the ID from the search results.
  • Forgetting the source agreement flags. On first use, winget asks you to accept source agreements. If you’re scripting, add the flags to avoid hangs.
  • Installing the wrong edition. Some apps have multiple versions (e.g., “VLC” vs “VLC (64-bit)”). Check the search output and choose the one that matches your system.
  • Running without admin rights when needed. Some installers require elevation. If you get an error about permissions, close and reopen the terminal as administrator.
  • Assuming all apps are in winget. Winget doesn’t cover every piece of software. If you can’t find a package, you may need to install manually.
  • Using --force unnecessarily. The --force flag bypasses checks and can break dependencies. Only use it when you understand the risk.

Tips

  • Use winget search with the source filter. Add --source winget to limit results to the community repository, which has more software than the Microsoft Store.
  • Create a one-command update. Combine winget upgrade --all with the accept flags: winget upgrade --all --accept-package-agreements --accept-source-agreements. Run it weekly to keep everything fresh.
  • Check for pending updates. Use winget upgrade (without --all) to see what’s outdated without updating.
  • Use the --silent flag for quiet installs. Some installers respond to --silent or --quiet; winget passes these to the installer. This is useful for automation.
  • Learn the --location flag. To install to a custom directory, add --location "D:\Apps". Not all installers respect this, but many do.
  • Keep winget itself updated. The tool updates via the Microsoft Store. Check winget --version periodically and update the App Installer if needed.

Troubleshooting

  • “No package found matching input” – Double-check the ID. Run winget search again and copy the exact ID. Also try adding --source winget.
  • “Failed to download source” or source errors – This often means network issues or a corrupted cache. Run winget source reset --force to rebuild the source list.
  • “Installer hash mismatch” – The file changed after publication. Run winget install --ignore-security-hash <ID> to bypass (use with caution), or wait for the package maintainer to update.
  • “App is not installed” after a successful install – Some apps require a reboot or a log-out. Also check if the app installed per-user; run winget list to confirm.
  • Winget not recognized – Ensure you’re on Windows 11 with the latest updates. If not, install “App Installer” from the Microsoft Store. Then restart your terminal.
  • “Access denied” errors – Close the terminal and reopen as administrator. Right-click the terminal icon and select “Run as administrator”.
  • Updates fail with a specific error code – Look up the code online, but first try winget upgrade --all --force to force the update. If that fails, uninstall and reinstall the app.

Frequently Asked Questions

  • Is winget safe to use? Yes, it only installs from trusted sources (winget community repo and Microsoft Store). However, always check the publisher and source before installing.
  • Can I use winget to install apps from the Microsoft Store? Yes, many Store apps are available via the msstore source. Search with --source msstore.
  • How do I update winget itself? Winget updates automatically through the Microsoft Store’s App Installer. You can also manually check by searching for “App Installer” in the Store.
  • Does winget work on Windows 10? Yes, it’s available on Windows 10 1809 and later, but this guide focuses on Windows 11. The commands are the same.
  • Can I use winget in a script or CI/CD? Absolutely. Use the --accept-* flags and --silent to make it non-interactive. For example: winget install --id Git.Git --silent --accept-package-agreements --accept-source-agreements.
  • Why does winget sometimes install an older version? The repository may not have the latest version yet. Check winget show <ID> to see the available version, and consider updating the package manifest or using the publisher’s site.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →