How to Use "winget" to Install Apps from Command Line on Windows 10
Windows 10
The Windows Package Manager, known as winget, is a command-line tool developed by Microsoft that enables Windows 10 users to download and install applications directly from the command prompt. Although it's currently in preview, you can test it on any Windows 10 PC by downloading it from the official GitHub repository.
Users running the latest Windows 10 Insider build might already have winget installed on their systems. To verify its presence, open Command Prompt or PowerShell and enter the following command:
winget --versionIf you're on a stable release of Windows 10, you'll need to manually download and install winget on your machine. You can obtain it from the official GitHub repository and follow the installation instructions provided there.
This guide will explore the basics of using winget, including how to install applications, search for them, and retrieve detailed information directly from the command line.
The winget CLI tool shares a familiar syntax with popular Linux package managers like apt or dnf. You can use winget from either Command Prompt or Windows PowerShell. The general syntax for winget commands is:
winget <command> <arguments>To begin, here's how to install an application from the command line using winget.
Winget install app command
Similar to the apt install command on Ubuntu systems, you can use the winget install command to download and install applications on a Windows 10 PC.
winget install <app-name>
For example:
winget install 7zipWhen you execute this command, winget will download and automatically install the specified application. If a User Account Control (UAC) prompt appears, click 'Yes' to proceed with the installation.
C:\Users\ATH> winget install 7zip
Found 7Zip [7zip.7zip]
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://www.7-zip.org/a/7z1900-x64.msi
██████████████████████████████ 1.66 MB / 1.66 MB
Successfully verified installer hash
Installing ...
Successfully installed!Winget install usage and flags
Here are all the supported options and flags for the winget install command, as displayed when you run winget install --help:
usage: winget install [[-q] <query>] <options>
The following arguments are available:
-q,--query The query used to search for an app
The following options are available:
-m,--manifest The path to the manifest of the application
--id Filter results by id
--name Filter results by name
--moniker Filter results by app moniker
-v,--version Use the specified version; default is the latest version
-s,--source Find app using the specified source
-e,--exact Find app using exact match
-i,--interactive Request interactive installation; user input may be needed
-h,--silent Request silent installation
-o,--log Log location (if supported)
--override Override arguments to be passed on to the installer
-l,--location Location to install to (if supported)Winget search app command
To find an application, you can use the winget search command.
winget search <app-name>
For example:
winget search 7zipIf a package named '7zip' exists in the repository, the winget search command will display the Package Name, ID, and Version in the output.
C:\Users\ATH> winget search 7zip
Name Id Version Matched
------------------------------------
7Zip 7zip.7zip 19.0.0 Moniker: 7zipWinget search usage and flags
Here are the available options and flags for the winget search command, as shown when you run winget search --help:
usage: winget search [[-q] <query>] <options>
The following arguments are available:
-q,--query The query used to search for an app
The following options are available:
--id Filter results by id
--name Filter results by name
--moniker Filter results by app moniker
--tag Filter results by tag
--command Filter results by command
-s,--source Find app using the specified source
-n,--count Show no more than specified number of results
-e,--exact Find app using exact matchWinget show app command
Although the winget search command provides basic details about an application, you can obtain comprehensive information—including the author, description, license, and more—by using the winget show command.
winget show <app-name>
For example:
winget show 7zipRunning winget show will display all pertinent information about the package, providing you with detailed insights directly from the command line.
C:\Users\ATH> winget show 7zip
Found 7Zip [7zip.7zip]
Version: 19.0.0
Publisher: 7zip
Author: 7zip
AppMoniker: 7zip
Description: Free and open source file archiver with a high compression ratio.
Homepage: https://www.7-zip.org/
License: Copyright (C) 1999-2020 Igor Pavlov. - GNU LGPL
License Url: https://7-zip.org/license.txt
Installer:
SHA256: a7803233eedb6a4b59b3024ccf9292a6fffb94507dc998aa67c5b745d197a5dc
Download Url: https://www.7-zip.org/a/7z1900-x64.msi
Type: MsiWinget show usage and flags
Below are the options and flags available for the winget show command, as displayed when you run winget show --help:
usage: winget show [[-q] <query>] <options>
The following arguments are available:
-q,--query The query used to search for an app
The following options are available:
-m,--manifest The path to the manifest of the application
--id Filter results by id
--name Filter results by name
--moniker Filter results by app moniker
-v,--version Use the specified version; default is the latest version
-s,--source Find app using the specified source
-e,--exact Find app using exact match
--versions Show available versions of the appIn summary, we've demonstrated how to search for and install applications using the winget package manager on Windows 10, and explored some of its basic commands and usage. The winget package manager has evolved significantly and is now included in stable builds of Windows 10 and Windows 11, providing users with a convenient way to manage applications directly from the command line.
Comments