[ TechDocsCove ]  TechDocsCove en   ↩︎

# Comprehensive Guide to Using Windows Package Manager (winget) in Windows

cmd   software-management   system-administration   windows  

translations: [ fr/Français ] · [ es/Español ] · [ de/Deutsch ]


Table of contents


Comprehensive Guide to Using Winget in Windows

Windows Package Manager (winget) is a command-line utility that simplifies the installation, upgrade, and management of applications on Windows. This guide delves deep into the winget tool, covering everything from basic installation to advanced management tasks such as refreshing, upgrading, purging, and cleaning cache and metadata.

Introduction to Winget

Winget is part of the Windows Package Manager, a Microsoft-developed tool that enables users to discover, install, upgrade, and configure applications on Windows 10 and Windows 11. It aims to streamline software management through a command-line interface (CLI), offering a powerful alternative to manual installations and updates.

Installing Winget

Winget is included by default in Windows 10 (version 1709 and later) and Windows 11. If you need to manually install or update winget, you can do so through the Microsoft Store by installing the “App Installer” package.

Basic Usage

Installing Applications

To install an application, use the install command followed by the application’s ID:

winget install Microsoft.VisualStudioCode

Searching for Applications

Find applications by name or keyword with the search command:

winget search vscode

Viewing Application Information

Get detailed information about an application, including its ID, version, and license:

winget show Microsoft.VisualStudioCode

Advanced Management

Upgrading Applications

Upgrade an application to the latest version:

winget upgrade Microsoft.VisualStudioCode

To upgrade all applications to their latest versions, use:

winget upgrade --all

Uninstalling Applications

Remove an application from your system:

winget uninstall Microsoft.VisualStudioCode

Working with Multiple Sources

Winget allows adding, removing, and managing multiple package sources. To add a source:

winget source add --name <source-name> --arg <source-url>

Refreshing Package Cache

Refresh the local package cache to ensure you’re working with the latest package metadata:

winget source update

Purging and Cleaning

To clean up leftover files and cache data to free up space and maintain system performance, winget provides commands for purging and cleaning:

Cleaning Cache

winget clean

This command removes cached downloads and temporary files created during package installations.

Resetting Winget

If you encounter issues with winget, resetting its state can help:

winget reset

This command purges winget’s state, including local databases and cache, effectively “restarting” winget’s operational state.

Exporting and Importing Packages

Winget supports exporting your list of installed packages to a file, which can be useful for setting up a new device or sharing configurations:

winget export -o packages.json

You can then import these packages on another machine:

winget import -i packages.json

Conclusion

Winget significantly simplifies application management on Windows, offering powerful command-line functionality for installing, upgrading, and maintaining software. By mastering winget commands and features, users can efficiently manage their applications, ensuring they’re always up to date and securely configured.



Created on: May 25, 2024


Email shareIcon for sharing via email    Reddit shareIcon for sharing via Reddit    X shareIcon for sharing via X    Telegram shareIcon for sharing via Telegram    WhatsApp shareIcon for sharing via WhatsApp    Facebook shareIcon for sharing via Facebook    LinkedIn shareIcon for sharing via LinkedIn



Discover More within this Subject: