Windows Package Manager
WinGet Client
If you are new to the Windows Package Manager, you might want to Explore the Windows Package Manager tool. The client has access to packages from two default sources. The first is «msstore» the Microsoft Store (free Apps rated «e» for everyone). The second is «winget» the WinGet community repository.
Note
Group policy may be configured and modify configured sources. Run winget --info
to see any configured policies.
Installing The Client
Note
The client requires Windows 10 1809 (build 17763) or later at this time. Windows Server 2019 is not supported as the Microsoft Store is not available nor are updated dependencies. It may be possible to install on Windows Server 2022, this should be considered experimental (not supported) and requires dependencies to be manually installed as well.
Microsoft Store [Recommended]
The client is distributed within the App Installer package.
Development Releases
There are two methods to get development releases:
- Install a Windows 10 or Windows 11 Insider build.
- Join the Windows Package Manager Insider program by signing up.
Note
It may take a few days to get the updated App Installer after you receive e-mail confirmation from joining the Windows Package Manager Insider program. If you decide to install the latest release from GitHub, and you have successfully joined the insider program, you will receive updates when the next development release has been published in the Microsoft Store.
Once you have received the updated App Installer from the Microsoft Store you should be able to execute winget features
to see experimental features. Some users have reported issues with the client not being on their PATH.
Manually Update
The same Microsoft Store package will be made available via our Releases. Note that installing this package will give you the WinGet client, but it will not enable automatic updates from the Microsoft Store if you have not joined the Windows Package Manager Insider program.
Note
You may need to install the VC++ v14 Desktop Framework Package.
This should only be necessary on older builds of Windows 10 and only if you get an error about missing framework packages.
Troubleshooting
Please read our troubleshooting guide.
Administrator Considerations
Installer behavior can be different depending on whether you are running WinGet with administrator privileges.
-
When running WinGet without administrator privileges, some applications may require elevation to install. When the installer runs, Windows will prompt you to elevate. If you choose not to elevate, the application will fail to install.
-
When running WinGet in an Administrator Command Prompt, you will not see elevation prompts if the application requires it. Always use caution when running your command prompt as an administrator, and only install applications you trust.
Build your own
You can also build the client yourself. While the client should be perfectly functional, we are not ready to provide full support for clients running outside of the official distribution mechanisms yet. Feel free to file an Issue, but know that it may get lower prioritization.
Build Status
Windows Package Manager Release Roadmap
The plan for delivering the next Windows Package Manager release is described and included in our discussions, and will be updated as the project proceeds.
Overview of the Windows Package Manager
The Windows Package Manager is a tool designed to help you quickly and easily discover and install those packages that make your PC environment special. By using the Windows Package Manager, from one command, you can install your favorite packages:
winget install <package>
Overview
Client Repository
This winget-cli repository includes the source code designed to build the client. You are encouraged to participate in the development of this client. We have plenty of backlog features in our Issues. You can upvote the ones you want, add more, or even get started on one.
Sources
The client is built around the concept of sources; a set of packages effectively. Sources provide the ability to discover and retrieve the metadata about the packages so that the client can act on it.
- The default «winget» source includes packages in the Windows Package Manager Community Repository.
- The default «msstore» source includes packages in the Microsoft Store.
- It is also possible to host your own private REST-based source.
Building the client
Please follow our developer guidance to build, run & test the client.
Credit
We would like to thank Keivan Beigi (@kayone) for his work on AppGet which helped us with the initial project direction for Windows Package Manager.
Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and do, actually grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. More
information is available in our CONTRIBUTING.md file.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct.
For more information, please refer to the Code of Conduct FAQ or
contact opencode@microsoft.com with any additional questions or comments.
Data/Telemetry
The winget.exe client is instrumented to collect usage and diagnostic (error) data and sends it to Microsoft to help improve the product.
If you build the client yourself the instrumentation will not be enabled and no data will be sent to Microsoft.
The winget.exe client respects machine-wide privacy settings and users can opt out on their device, as documented in the Microsoft Windows privacy statement. In addition, you may also explicitly block telemetry using settings
In short, to opt out, do one of the following:
Windows 11: Go to Start
, then select Settings
> Privacy & Security
> Diagnostics & feedback
> Diagnostic data
and unselect Send optional diagnostic data
.
Windows 10: Go to Start
, then select Settings
> Privacy
> Diagnostics & feedback
, and select Required diagnostic data
.
See the privacy statement for more details.
Не все знают, но в Windows последних версий по умолчанию присутствует менеджер пакетов Winget. Возможность может быть полезной как для тех, кто ранее пользовался подобными инструментами установки программ, так и для не сталкивавшихся с диспетчерами пакетов пользователей.
В этом обзоре подробно о том, как пользоваться диспетчером или менеджеров пакетов winget в Windows 11 и Windows 10, а для начинающих пользователей — о том, что это такое и почему функция может быть удобной.
Что такое менеджер или диспетчер пакетов winget (Windows Package Manager)
Менеджеры (или диспетчеры) пакетов — обычное дело для Linux и позволяют скачивать, устанавливать последние версии программ и обновлять их без поиска официальных сайтов и ручной загрузки, а с помощью простых команд (при этом будут загружаться именно последние версии ПО из официальных источников), при этом обычно скачивание программ происходит именно с официального сайта разработчика, что более безопасно, чем использование сторонних источников. Теперь это можно выполнить и в Windows 10 или 11 с помощью Winget.
Впрочем, это можно было сделать и раньше с помощью OneGet/PackageManagement и Chocolatey, но теперь репозиторий (база данных программного обеспечения) поддерживаются Microsoft, а не сторонними поставщиками (но сами программы, напомню, скачиваются с официальных хранилищ разработчиков).
В отличие от магазина приложений Microsoft Store, с помощью winget пользователь может устанавливать куда больший набор самых различных часто используемых программ, не ограниченных довольно скудным ассортиментом из указанного магазина (но в последних версиях winget показывает и приложения из магазина).
Использование winget в Windows 11/10
Менеджер пакетов winget уже предустановлен в последних версиях Windows 11 и Windows 10. Проверить, установлен ли он у вас можно, запустив Терминал Windows или Windows Powershell от имени администратора (сделать это можно через меню по правому клику на кнопке «Пуск») и введя команду winget. Если в результате вы видите список доступных команд winget для установки приложений, значит он установлен на компьютере.
В более старых версиях Windows 10 winget отсутствует, но его можно установить, используя один из следующих способов:
- Скачать и установить файл установщика .appxbundle с официальной страницы https://github.com/microsoft/winget-cli/releases
- Установить Preview-версию Windows 10, зарегистрироваться в Insider-программе Windows Package Manager по ссылке а затем установить/обновить приложение «Установщик приложения» (App Installer) из Microsoft Store.
Теперь, для примера, попробуем найти и установить нужную нам программу. Учитывайте, что установить мы можем лишь распространяющиеся бесплатно программы, либо с возможностью бесплатного использования. Для поиска и установки нужен доступ в Интернет. Пусть это будет архиватор 7-Zip. Вводим команды:
-
winget search zip
Этой командой мы ищем все программы с «zip» в тексте, чтобы узнать, какое имя указывать в следующей команде.
- Как видим на скриншоте выше, в репозитории удалось найти множество программ, содержащих zip в названии, включая 7-Zip. Для установки пакета вводим команду winget install и имя (первый столбец) или ИД приложения (второй столбец). Если имя содержит пробелы, возьмите его в кавычки. Но лучше использовать ИД, так как при вводе имени большой шанс получить сообщение о том, что несколько программ содержат заданный набор символов в имени. Для 7-Zip из winget (не из msstore, источник смотрим в последнем столбце) команда будет следующей:
winget install 7zip.7zip
- Как видно на скриншоте выше, началась загрузка установщика с официального сайта 7-zip.org.
- Пробую аналогичным образом установить что-то еще, например, ShareX (одна из лучших программ для создания скриншотов и записи экрана для начинающих).
- Установленную программу мы можем удалить стандартными средствами Windows (программы и компоненты в панели управления или через интерфейс Параметры — Приложения) или с помощью команды
winget uninstall ИД_приложения
- При желании мы можем не устанавливать программу, а получить полную информацию о ней, включая контрольную сумму и прямую ссылку на загрузку. Для этого используется команда winget show имя_программы (или ИД)
- Есть возможность и обновления программ. Команда winget upgrade покажет список доступных к обновлению пакетов, далее её можно использовать с указанием имени/ИД пакета или в формате
winget upgrade --all
для обновления всех программ.
- Если вы хотите воспользоваться графическим интерфейсом для более удобного поиска нужных программ winget и создания команд установки, обратите внимание на WingetUI и Winstall.
Среди нескольких тысяч доступных к скачиванию и установки пакетов вы можете найти:
- Прикладные программы: браузеры, архиваторы, редакторы, проигрыватели, средства создания скриншотов и записи экрана, программы просмотра изображений и многие другие.
- Системные утилиты для работы с дисками, резервного копирования, шифрование, переименования файлов, отдельные инструменты из Sysinternals.
- Востребованные компоненты Windows, такие как .NET Framework, Распространяемые пакеты Visual C++ разных версий.
- ПО Майкрософт, самое разнообразное — от Microsoft PowerToys до Visual Studio Community Edition.
Список не полный: если вы что-то ищете, программа или компонент достаточно популярен и распространяется, в том числе, бесплатно, с большой вероятностью вы его найдёте в winget.
From Wikipedia, the free encyclopedia
Developer(s) | Microsoft |
---|---|
Initial release | 13 May 2020; 4 years ago |
Stable release |
1.9.25200[1] |
Preview release |
1.9.2151-preview[2] |
Repository | github |
Written in | C++,[3] XML,[3] C,[3] C#,[3] Python,[3] Extensible Application Markup Language,[3] CMake,[3] Ada,[3] shell script,[3] Perl,[3] Pascal,[3] XSLT,[3] Autoconf,[3] HTML,[3] PowerShell,[3] DIGITAL Command Language,[3] JavaScript,[3] make,[3] assembly language[3] |
Operating system | Windows 10 or later |
Size | ~23 MB |
Available in | Chinese, English, French, German, Japanese, and others |
Type | package manager, installation |
License | MIT License[4] |
Website | learn |
The Windows Package Manager (also known as winget) is a free and open-source package manager designed by Microsoft for Windows 10 and Windows 11. It consists of a command-line utility and a set of services for installing applications.[5][6] Independent software vendors can use it as a distribution channel for their software packages.
Windows Package Manager was first announced at the Microsoft Build developer conference in May 2020.[7][6]
Before deciding to develop Windows Package Manager, the team behind it explored Chocolatey, Scoop, Ninite, AppGet, Npackd and the PowerShell-based OneGet.[6] After the announcement of winget, the developer of AppGet, Keivan Beigi, claimed that Microsoft interviewed him in December 2019 under the pretense of employment and acquiring AppGet.[8] After talking with Beigi, Microsoft allegedly ceased communication with him until confirming one day before the launch of winget that they would not be hiring him. Beigi was dismayed at Microsoft’s lack of attribution of AppGet. The release of winget led Beigi to announce that AppGet would be discontinued in August 2020.[8][9][10] Microsoft responded with a blog post crediting a number of winget’s features to AppGet.[11][12][13]
Microsoft released version 1.0 of Windows Package Manager on May 27, 2021. The Microsoft Community Repository included over 1,400 packages at that date.[14]
The winget tool supports installers based on EXE, MSIX, and MSI.[15] The public Windows Package Manager Community repository hosts manifest files for supported applications in YAML format.[16] In September 2020, Microsoft added the ability to install applications from the Microsoft Store and a command auto-completion feature.[17]
To reduce the likelihood of non-Microsoft-approved software, including malicious software, making its way into the repository and onto the target machine, Windows Package Manager uses Microsoft SmartScreen, static analysis, SHA256 hash validation and other processes.[18][19]
The winget client source code and the community manifest repository are licensed under MIT License and hosted on GitHub.[20][16]
Name | Description |
---|---|
configure | Configures the system into a desired state |
export | Exports a list of the installed applications |
features | Show status of experimental features |
hash | Hash installer files |
import | Install all the applications in a file |
install | Install the given application |
list | Display installed applications |
pin | Manage package upgrade pins |
show | Show information about the given application |
search | Search and show basic information of applications |
settings | Open winget configuration settings |
source | Manage application sources |
upgrade | Upgrades the given application |
uninstall | Uninstall the given application |
validate | Validate a manifest file |
Search for and installs variable $PKG_ID
:
winget install --id=$PKG_ID -e
List all installed packages:
Update all packages:
Package ID examples
[edit]
- Visual Studio Code, a code editor from Microsoft:[21]
Microsoft.VisualStudioCode
- Google Chrome:[22]
Google.Chrome
- Mozilla Firefox:
Mozilla.Firefox
- Brave:
BraveSoftware.BraveBrowser
- Vivaldi:
VivaldiTechnologies.Vivaldi
- Web Platform Installer
- NuGet
- Chocolatey
- Scoop Package Manager
- List of software package management systems
- vcpkg
- ^ «Windows Package Manager 1.9.25200». GitHub. 12 November 2024. Retrieved 15 December 2024.
- ^ «Release Windows Package Manager 1.9.2151-preview». GitHub. 7 August 2024. Retrieved 20 August 2024.
- ^ a b c d e f g h i j k l m n o p q r s «The winget-cli Open Source Project on Open Hub: Languages Page». Open Hub. Retrieved 18 May 2024.
- ^ «winget-cli/LICENSE at master». GitHub. 17 July 2019. Retrieved 4 August 2020.
- ^ Tom Warren (20 May 2020). «Microsoft’s new Windows Package Manager is already better than the Windows Store». The Verge.
- ^ a b c Windows Package Manager Preview | Windows Command Line
- ^ Microsoft debuts Windows Package Manager for your dev environment | VentureBeat
- ^ a b Warren, Tom (28 May 2020). «Microsoft copied its new Windows Package Manager from rival AppGet, claims developer». The Verge. Vox Media. Retrieved June 1, 2020.
- ^ Anderson, Tim (May 28, 2020). «Embrace and kill? AppGet dev claims Microsoft reeled him in with talk of help and a job – then released remarkably similar package manager». The Register. Retrieved 2020-06-01.
- ^ Stewart, Ashley (May 28, 2020). «A developer says Microsoft led him on about a job and buying his tool before going silent and releasing its own very similar service. Now he wants an explanation and credit for his work». Business Insider. Retrieved June 1, 2020.
- ^ Tung, Liam (June 1, 2020). «Windows 10: Microsoft now credits maker of package manager it ‘copied’ – but offers no apology». ZDNet. Retrieved 2020-06-02.
- ^ Microsoft gives AppGet creator credit for Windows Package Manager — Neowin
- ^ Warren, Tom (April 20, 2022). «Microsoft finally gives AppGet developer the credit he deserves». The Verge. Retrieved 2020-06-02.
- ^ Anderson, Tim (May 27, 2021). «Microsoft releases command-line package manager for Windows (there are snags)». The Register. Retrieved 2021-05-28.
- ^ a b «Use the winget tool to install and manage applications». Microsoft.
- ^ a b GitHub — microsoft/winget-pkgs: The Microsoft community Windows Package Manager manifest repository
- ^ Abrams, Lawrence (September 23, 2020). «Windows 10 Package Manager can now install Microsoft Store apps». Bleeping Computer. Retrieved 2020-10-10.
- ^ Tung, Liam (May 21, 2020). «Microsoft’s Windows Package Manager: This command-line tool can install all your apps». ZDNet. Retrieved 2020-06-02.
- ^ How to Use Windows Package Manager — Petri
- ^ «GitHub — microsoft/winget-cli: Windows Package Manager CLI (a.k.a. winget)». May 20, 2020 – via GitHub.
- ^ «Winget PKG of Visual Studio Code» https://winget.run/pkg/Microsoft/VisualStudioCode
- ^ «Winget PKG of Google Chrome» https://winget.run/pkg/Google/Chrome
- Windows Package Manager | Microsoft Docs
- winget-cli on GitHub
- winget-pkgs on GitHub
- UniGetUI (formerly WingetUI) — Community-made GUI for Winget
В этой публикации, друзья, рассмотрим WinGet (Windows Package Manager) — менеджер пакетов Windows. Его также называют диспетчером пакетов. Это консольный инструмент в Windows 10 и 11, работает с помощью командной строки или PowerShell. Позволяет устанавливать и обновлять программы и приложения, в том числе в пакетном режиме, а также удалять их. Работает аналогично менеджерам пакетов в Linux. Не всем, конечно, WinGet нужен, но отдельным опытным пользователям и системщикам организаций может предложить автоматизацию установки и обновления софта.
Для упрощения установки и обновления софта в Windows 10 и 11 есть магазин Microsoft Store. В нём можно централизовано устанавливать и обновлять современные UWP-приложения, в том числе пакетно. Все наши приложения из магазина могут синхронизироваться при использовании функции синхронизации настроек и данных компьютера. И мы сможем оперативно, в пакетном режиме установить свои приложения при новой установке операционной системы. Плюс к этому, в Microsoft Store можно устанавливать некоторые классические программы Win32. Microsoft Store – это инструмент-минимум, в нём есть не весь нужный нам софт, тем не менее многим из пользователей хватит возможностей магазина. Не весь возможный Windows-софт может предложить и WinGet, но всё же у последнего ассортимент побольше, чем у магазина.
WinGet – это менеджер пакетов в составе Windows 10 и Windows 11. И это проект с открытым исходным кодом на GitHub, поддерживаемый компанией Microsoft. Менеджер пакетов – это программа для управления программами, которая может их искать, устанавливать, обновлять, удалять. И мы, пользователи все эти задачи можем выполнять централизовано, в одном месте. И, что немаловажно, менеджеры пакетов – это установка софта из надёжных источников, а, соответственно, для нас это гарантия безопасности.
WinGet – это простота установки софта для тех, кто привык работать с консольными командами. Вместо поиска источника скачивания программы, самого процесса скачивания, установки с прохождением разных этапов, можно просто ввести в консоль определённую команду, и программа тихо установится в фоне с теми же стандартными предустановками, которые мы по большей части не меняем.
Как любой менеджер пакетов, Winget работает с источниками установки софта. Изначально это Microsoft Store и репозиторий, поддерживаемый компанией Microsoft — Microsoft Community Repository. Последний предоставляет данные о доступных программах сторонних разработчиков и обеспечивает скачивание дистрибутива с официальных сайтов таких программ.
При необходимости можно подключить сторонние репозитории.
С помощью WinGet можно установить широкий спектр ПО — для работы, развлечений, творчества, обучения и много другого. Репозиторий WinGet постоянно расширяется, на данный момент содержит более 30 тыс. программ.
WinGet предустановлен в Windows 10 (начиная с версии 1709) и Windows 11. Проверить его установку можно, запустив в терминале Windows 11, командной строке или PowerShell команду:
winget
Если WinGet установлен, увидим описание WinGet и перечень команд для работы с ним.
В старых версиях Windows 10 или кастомных Windows 10 и 11, из которых, возможно, WinGet вырезан, установить его можно, скачав установщик с GitHub.
Начать работу с WinGet можем с получения списка установленных на компьютере программ. В терминал Windows 11, командную строку или PowerShell вводим команду:
winget list
В ответ получим перечень установленных программ и приложений с указанием их ИД, версии текущей и доступной для обновления. Также перечень будет содержать указание на источник программы или приложения. В каких-то случаях источника не будет, это значит, что программы или приложения нет в Microsoft Store и репозитории Microsoft Community Repository. В каких-то случаях источником будет msstore, т.е. магазин Microsoft Store. А в каких-то случаях источником будет winget, т.е. репозиторий Microsoft Community Repository. Программы и приложения, для которых указан источник msstore или winget, можно устанавливать и обновлять с помощью WinGet. Программы и приложения, для которых источник не указан, можно только удалить.
Для удаления программы или приложения используем команду по типу:
winget uninstall MicrosoftTeams_8wekyb3d8bbwe
Где вместо MicrosoftTeams_8wekyb3d8bbwe каждый подставляет идентификатор своего софта.
В приведённом примере мы удалили приложение Microsoft Teams, но вновь с использованием этого же идентификатора приложение может не установится. Для установки программ и приложений с помощью WinGet сначала необходимо выполнить поиск по ключевому слову. Например, мы снова хотим установить Microsoft Teams. И мы будем искать его по ключевому слову «Teams». Вводим команду:
winget search Teams
Где Teams – это ключевое слово, и вместо него каждый подставляет своё. Получаем перечень доступных для установки с помощью WinGet программ и приложений по этому ключевому слову. Смотрим, где наше приложение Microsoft Teams в этом перечне. Копируем его идентификатор в этом перечне.
И устанавливаем приложение командной с использованием этого идентификатора:
winget install Microsoft.Teams
В этой команде вместо Microsoft Teams каждый подставляет свой идентификатор устанавливаемого софта.
Из интересных возможностей WinGet – пакетное обновление софта. Вводим команду:
winget upgrade --all
Запустится установка обновлений программ и приложений. Можем посмотреть, что за софт WinGet сейчас нам обновит.
Заблокировать обновление определённых программ и приложений, чтобы они были исключены из пакетного обновления, можно командной по типу:
winget pin add Google.Chrome –blocking
Где вместо Google.Chrome каждый подставляет свой софт.
Друзья, WinGet примечателен возможностью пакетной установки программ.
Можем выполнить экспорт списка установленного софта, команда:
winget export -o D:\app.json
Где D:\app.json – это файл и путь сохранения списка, у каждого свой.
Затем можем выполнить пакетную установку софта из этого экспортированного списка, команда:
winget import -i D:\app.json --accept-source-agreements --accept-package-agreements --ignore-unavailable
Где D:\app.json – это файл и путь экспортированного списка софта, у каждого свой. В команду добавлены аргументы, решающие вопросы с принятием лицензии софта и игнором версий софта, чтобы были установлены самые свежие версии.
Ещё можем выполнить пакетную установку софта, создав скрипт с указанием идентификаторов нужных нам программ и приложений. В блокнот Windows вписываем команду по типу:
winget install --id=TechPowerUp.GPU-Z -e && winget install --id=Google.Chrome -e && winget install --id=Viber.Viber -e &&
Где TechPowerUp.GPU, Google.Chrome, Viber.Viber – это идентификаторы программ и приложений, и каждый подставляет вместо них свои.
Далее файл в блокноте сохраняем под любым именем с расширением .bat. И запускаем созданный батник.
Друзья, мы рассмотрели только ключевые возможности и команды WinGet. Больше возможностей, больше команд менеджера пакетов получим на ресурсе документации Microsoft.
Если возможности WinGet вас заинтересовали, но вы не любитель консолей, можете работать с менеджером пакетов с использованием графического интерфейса. Таковой реализует программа WingetUI. И ещё есть утилита UpdateHub, работающая в связке с WinGet, она предлагает комплексное обновление программ, приложений и самой Windows.
Introduction
In the ever-evolving world of software management, the introduction of winget, a command-line package manager for Windows, has revolutionized the way users install, update, and manage applications on their systems. Winget, short for Windows Package Manager, is a powerful tool that simplifies the process of finding, installing, and maintaining software packages, making it an essential utility for Windows users and IT professionals alike.
What is winget?
Winget is a free and open-source package manager developed by Microsoft as part of the Windows 10 May 2020 Update (version 2004). It is designed to provide a consistent and efficient way to install and manage software packages on Windows systems, similar to how package managers like apt-get and brew work on Linux and macOS, respectively.
Benefits of using winget
- Streamlined installation: Winget allows you to install software packages directly from the command line, eliminating the need to manually download and run installers.
- Automated updates: With winget, you can easily keep your installed packages up-to-date by running a single command, ensuring that your software is always secure and feature-rich.
- Consistent experience: Winget provides a standardized way to interact with software packages, making it easier to manage and maintain your system’s software ecosystem.
- Extensive package repository: The winget package repository contains a vast collection of popular software packages, covering a wide range of categories, from productivity tools to entertainment applications.
- Scripting and automation: Winget’s command-line interface allows you to incorporate package management tasks into scripts and automation workflows, streamlining your software management processes.
Installing winget
To use winget on your Windows system, you need to ensure that you have the latest version of Windows 10 (version 2004 or later) or Windows 11 installed. If you meet this requirement, winget should already be available on your system.
If you are using an older version of Windows 10, you can install winget by following these steps:
- Download the latest version of the Windows Package Manager from the GitHub releases page: https://github.com/microsoft/winget-cli/releases
- Extract the downloaded ZIP file to a directory of your choice.
- Open an elevated command prompt (run as administrator) and navigate to the extracted directory.
- Run the following command to install winget:
C:\> winget install --id=Microsoft.DesktopAppInstaller --source winget
After the installation is complete, you can start using winget to manage your software packages.
Basic winget commands
Here are some of the most commonly used winget commands:
Installing packages
To install a package using winget, use the following command:
C:\> winget install <package_id>
Replace <package_id>
with the unique identifier of the package you want to install. For example:
C:\> winget install 7zip.7zip
This command will install the 7-Zip file archiver.
Searching for packages
To search for available packages, use the following command:
C:\> winget search <search_term>
Replace <search_term>
with the keyword or package name you want to search for. For example:
C:\> winget search notepad
This command will display a list of packages related to Notepad.
Updating packages
To update a specific package, use the following command:
C:\> winget upgrade <package_id>
Replace <package_id>
with the unique identifier of the package you want to update. For example:
C:\> winget upgrade 7zip.7zip
This command will update the 7-Zip file archiver to the latest version.
To update all installed packages, use the following command:
C:\> winget upgrade --all
Uninstalling packages
To uninstall a package using winget, use the following command:
C:\> winget uninstall <package_id>
Replace <package_id>
with the unique identifier of the package you want to uninstall. For example:
C:\> winget uninstall 7zip.7zip
This command will uninstall the 7-Zip file archiver from your system.
Listing installed packages
To list all the packages installed on your system using winget, use the following command:
C:\> winget list
This command will display a list of all the installed packages on your system.
Advanced winget commands and features
Winget offers a range of advanced commands and features that allow you to customize and optimize your package management experience.
Specifying package versions
When installing or upgrading packages, you can specify a particular version of the package using the --version
flag. For example:
C:\> winget install <package_id> --version <version_number>
Replace <package_id>
with the package identifier and <version_number>
with the desired version number. This command will install the specified version of the package.
Exporting and importing package lists
Winget allows you to export a list of installed packages to a file and later import the same list to another system. This feature is useful for creating backups, sharing package lists with others, or setting up new systems with the same software configuration.
To export the list of installed packages, use the following command:
C:\> winget export <output_file>
Replace <output_file>
with the desired name and location of the output file. For example:
C:\> winget export C:\packages.json
This command will create a JSON file named packages.json
in the root directory, containing a list of all the installed packages.
To import a package list from a file, use the following command:
C:\> winget import <input_file>
Replace <input_file>
with the path to the JSON file containing the package list. For example:
C:\> winget import C:\packages.json
This command will install all the packages listed in the packages.json
file.
Configuring winget settings
Winget allows you to customize its behavior by modifying the settings file located at %LOCALAPPDATA%\Microsoft\winget\settings\settings.json
. Some of the configurable settings include:
- Source management: You can add, remove, or update package sources (repositories) that winget uses to find and install packages.
- Manifest validation: You can configure winget to validate package manifests against a specific schema version.
- Logging: You can enable or disable logging and specify the log file location.
To edit the settings file, open it with a text editor and make the desired changes. Save the file, and winget will use the updated settings.
Using winget with scripts and automation
Winget’s command-line interface makes it easy to integrate package management tasks into scripts and automation workflows. You can use winget commands in batch files, PowerShell scripts, or any other scripting language that supports running external commands.
Here’s an example of a PowerShell script that installs or updates a list of packages:
$packages = @(
"7zip.7zip",
"Mozilla.Firefox",
"Notepad++.Notepad++"
)
foreach ($package in $packages) {
winget install --id $package --source winget --accept-source-agreements --accept-package-agreements --silent
}
This script defines an array of package IDs, loops through each package, and installs or updates it using winget with silent mode enabled.
By incorporating winget commands into your scripts, you can streamline software deployment, maintenance, and configuration tasks, making your workflows more efficient and consistent.
Troubleshooting and common issues
While winget is generally reliable, you may encounter some issues or error messages during its usage. Here are some common problems and their potential solutions:
Package not found
If you receive an error stating that the specified package cannot be found, ensure that you are using the correct package ID. You can search for the package using the winget search
command to verify the correct ID.
If the package is not available in the default winget source, you may need to add a custom source or use a different package ID.
Installation failure
If a package fails to install, check the error message for more information. Common reasons for installation failures include:
- Insufficient permissions
- Conflicting software
- Incompatible system architecture
- Outdated package manifest
Try running the installation command with elevated privileges (as an administrator) and check if the package is compatible with your system’s architecture (e.g., 32-bit vs. 64-bit).
Outdated package manifest
Winget relies on package manifests provided by the package sources. If a package manifest is outdated or incorrect, it may cause issues during installation or updating. In such cases, you can try updating the package source using the winget source update
command or report the issue to the package source maintainers.
Logging and troubleshooting
Winget provides logging capabilities to help you diagnose and troubleshoot issues. By default, logs are stored in the %TEMP%\winget\
directory. You can enable more detailed logging by modifying the settings.json
file and setting the "logging"
section accordingly.
If you encounter persistent issues or need further assistance, you can refer to the winget documentation, search for solutions in the winget community forums, or report the issue on the winget GitHub repository.
Use cases and examples
Winget can be used in various scenarios to streamline software management tasks. Here are some examples of how you can utilize winget:
Deploying software to multiple systems
You can create a script that installs a set of pre-defined packages on multiple systems, ensuring consistent software configurations across your organization.
C:\> winget install --id 7zip.7zip --source winget
C:\> winget install --id Mozilla.Firefox --source winget
C:\> winget install --id Notepad++.Notepad++ --source winget
Updating software on a regular basis
You can set up a scheduled task or script to run the winget upgrade --all
command periodically to keep all installed packages up-to-date.
C:\> winget upgrade --all
Restoring software on a new system
If you need to set up a new system with the same software configuration as an existing one, you can export the list of installed packages from the old system and import it on the new system using winget.
C:\> winget export C:\packages.json
C:\> winget import C:\packages.json
Automating software deployment in CI/CD pipelines
Winget’s command-line interface makes it easy to integrate package management tasks into continuous integration and continuous deployment (CI/CD) pipelines, ensuring that software is deployed consistently and efficiently.
C:\> winget install --id 7zip.7zip --source winget
Conclusion
Winget, the Windows Package Manager, is a powerful tool that simplifies software installation, updating, and management on Windows systems. By leveraging winget’s command-line interface and extensive package repository, you can streamline your software management workflows, ensure consistent software configurations, and keep your systems up-to-date with the latest versions of your favorite applications.
Whether you are an individual user looking to manage software on your personal computer or an IT professional responsible for maintaining a fleet of Windows systems, winget is a valuable addition to your toolset. By mastering winget’s commands and features, you can save time, reduce manual effort, and improve the overall efficiency of your software management processes.
As winget continues to evolve and gain popularity, its capabilities and package repository are expected to expand, making it an increasingly essential tool for Windows users and administrators alike. By embracing winget and incorporating it into your software management practices, you can stay ahead of the curve and optimize your Windows systems for maximum productivity and efficiency.