Windows Package Manager

Getting Started with Windows Package Manager: A Beginner’s GuideWindows Package Manager (winget) simplifies discovering, installing, updating, and managing software on Windows. If you’ve ever wished installing apps could be as fast as a single command, winget brings that convenience to Windows with a lightweight, scriptable CLI. This guide walks you through everything a beginner needs: installation, basic commands, workflows, tips, and examples to make everyday software management faster and more reliable.


What is Windows Package Manager?

Windows Package Manager (commonly called winget) is a command-line tool for installing and managing applications on Windows 10 and Windows 11. It connects to public repositories of application manifests (collections of metadata describing installers) so you can install apps by name, version, publisher, or source. Winget is created by Microsoft and integrated with the community-maintained Windows Package Manager Community Repository, but it also supports additional sources.

Key benefits:

  • Automated installs and updates through simple commands.
  • Scriptable for provisioning new machines or setting up developer environments.
  • Works with both GUI and silent installer packages (MSI, EXE, MSIX, etc.).

How to get winget

  1. Windows ⁄11 systems often include winget via the App Installer. To check:

    • Open Command Prompt or PowerShell and run:
      
      winget --version 
    • If you see a version number, winget is installed.
  2. If not installed, get the App Installer from the Microsoft Store:

    • Search “App Installer” in Microsoft Store and install it. That provides the winget CLI.
  3. You can also install via GitHub releases of Windows Package Manager if you need a specific build.


First steps: learning the help and search commands

  • Get help and see available commands:
    
    winget --help 
  • Search for applications:
    
    winget search <keyword> 

    Example:

    
    winget search vscode 

    The search lists package IDs, names, and sources. Package ID (like Microsoft.VisualStudioCode) is the most reliable identifier for installs and upgrades.


Installing apps

The basic install command:

winget install <package-id-or-name> 

Examples:

winget install Microsoft.VisualStudioCode winget install firefox 

You can install by exact package ID (recommended) or by name. If multiple matches exist, winget will prompt you to choose.

Common options:

  • –silent or –silent-with-progress: request a silent install (installer must support it).
  • –accept-package-agreements and –accept-source-agreements: accept EULAs/non-interactive provisioning in scripts.
  • –source: install from a specific source (e.g., winget, msstore).

Example with options:

winget install --id=Mozilla.Firefox --silent 

Updating and upgrading

  • To update a single package:
    
    winget upgrade <package-id-or-name> 
  • To list updatable packages:
    
    winget upgrade 
  • To upgrade all updatable packages:
    
    winget upgrade --all 

Note: Some packages require interactive installers for updates and may open GUI prompts.


Uninstalling packages

Remove an installed application:

winget uninstall <package-id-or-name> 

If multiple matches exist, winget will prompt for choice. For automation, use the package ID.


Listing and showing package details

  • List installed packages:

    winget list 

    Use filters or a package name to narrow results:

    winget list vscode 
  • Show package metadata (manifest details) from a repository:

    winget show <package-id-or-name> 

Sources and manifests

Winget uses sources (feeds) of manifests. The default includes the public community repository and the Microsoft Store. View sources:

winget source list 

Add or remove sources if you run a private feed:

winget source add -n MyRepo https://example.com/manifest/index winget source remove -n MyRepo 

Package manifests are YAML files describing installer URLs, checksum, installer types, and install switches. The community repository is on GitHub, so many manifests are community-contributed and regularly updated.


Creating and submitting manifests

If a package you need isn’t available, you can create a manifest:

  1. Use the wizard to generate a manifest skeleton:

    wingetcreate new 

    (You may need to install the wingetcreate utility from the community tools.)

  2. Edit the YAML to include correct installer URLs, hashes, and metadata.

  3. Test locally before submitting.

  4. Submit a pull request to the Windows Package Manager Community Repository following contributor guidelines.


Scripting and automation

Winget is ideal for provisioning and automation. Typical patterns:

  • A single script to install multiple apps:
    
    winget install --id=Microsoft.VisualStudioCode --silent winget install --id=Git.Git --silent winget install --id=Google.Chrome --silent 
  • Accept agreements for unattended installs:
    
    winget install --id=Some.App --accept-package-agreements --accept-source-agreements 
  • Combine with configuration tools (PowerShell DSC, Ansible, or Ninite replacements) for reproducible developer setups.

Troubleshooting common issues

  • “Package not found”: Use winget search <name> to get the correct package ID; check network and source list.
  • Install fails due to unsupported silent options: Some installers don’t support silent mode; omit –silent or use specific installer switches in manifest.
  • Permission issues: Run PowerShell or CMD as Administrator for system-wide installs.
  • Source sync problems: Try winget source update to refresh feeds.

Security and best practices

  • Prefer installing by package ID to avoid ambiguity.
  • Review manifest sources and check checksums where possible.
  • For corporates, use private sources and vet manifests before adding.
  • Keep winget and App Installer updated via Windows Update or Microsoft Store.

Examples — common workflows

  • Quick install Visual Studio Code:

    winget install --id=Microsoft.VisualStudioCode 
  • Set up a new dev machine (example script):

    winget install --id=Git.Git --silent --accept-package-agreements winget install --id=Microsoft.VisualStudioCode --silent winget install --id=NodeJS.Node --silent winget install --id=Google.Chrome --silent winget upgrade --all 
  • Export installed package list for reproducibility (manual approach):

    winget list > installed-packages.txt 

    (There’s no built-in export/import for full manifests yet; use scripts to parse and reinstall by IDs.)


Where to learn more

  • winget’s built-in help and command docs (winget --help, winget <command> --help).
  • Windows Package Manager Community Repository on GitHub for manifests and contribution guides.
  • Tutorials and community blog posts for advanced scenarios (private sources, custom manifests).

Getting comfortable with winget saves time and reduces friction when setting up systems. Start by installing a few apps, try scripting a simple setup, and gradually add manifest creation or private sources if you manage multiple machines.

Comments

Leave a Reply

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