The Windows Package Manager

ubuysa

The BSOD Doctor
I guess we all at one time or another wonder whether all our apps are up to date. Many apps do an auto update check, but often only when you start them, which means that apps you use only rarely need updating next time you use them. I have always been wary of third-party apps that claim to keep your apps updated, I treat them with the same suspicion I treat driver updater tools.

Whilst wondering whether I had any apps that needed updating I came across the Windows Package Manager, which does just that.

Introducing the Windows Package Manager
The Windows Package Manager has been part of Windows 11 since its first release, it's also included in later versions of Windows 10. At the moment it only exists as a command line tool, though I have no doubt that a GUI version will be available eventually. For those of us used to command line tools the package manager is a breeze to use, because there is only one command; winget - but with a ton of options.

The package manager is quite powerful and flexible, entering the winget --help command will bring up the main options. You can list installed packages, export a list, display the details of a specific package, validate a package manifest, repair an installed package, etc. etc.

At this point it's worth stating what a package actually is. For our purposes a package is an app. Microsoft Edge is a package, 7-Zip is a package, VLC Media Player is a package. The Windows Package Manager can manage packages for over 1500 packages (apps), although there are some apps that don't (yet) exist as a package that the package manager can manage, so not every app can be managed at the moment.

Upgrading installed packages
This is the only feature of the package manager that I'm going to talk about here. Partly because it's the only feature I have fully explored so far, but mainly because it's probably the only feature I will use. It is possible to use the package manager to install and uninstall packages (apps) but I don't see myself moving away from the traditional install/uninstall tools just yet.

Since it's a command line tool it's invoked either from the command prompt, the Windows terminal, or from a PowerShell session. It looks and feels the same no matter what tool you use.

The place to start is to see whether any of your installed packages (apps) have updates available. To do that you enter the command winget upgrade. Her's that display on my system...
Code:
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS C:\Users\ubuys> winget upgrade
Name                                        Id                           Version             Available           Source
-----------------------------------------------------------------------------------------------------------------------
7-Zip 23.01 (x64)                           7zip.7zip                    23.01               24.09               winget
Audacity 3.6.1                              Audacity.Audacity            3.6.1               3.7.0               winget
CPUID HWMonitor 1.53                        CPUID.HWMonitor              1.53                1.55                winget
TeamViewer                                  TeamViewer.TeamViewer        15.53.6             15.60.3             winget
VLC media player                            VideoLAN.VLC                 3.0.20              3.0.21              winget
calibre 64bit                               calibre.calibre              7.9.0               7.22.0              winget
Bonjour                                     Apple.Bonjour                3.0.0.10            3.1.0.1             winget
Microsoft Edge                              Microsoft.Edge               131.0.2903.70       131.0.2903.86       winget
SyncBackPro x64                             2BrightSparks.SyncBackPro    10.2.147.0          11.3.62.0           winget
Microsoft Visual C++ 2015-2022 Redistribut… Microsoft.VCRedist.2015+.x86 14.40.33810.0       14.42.34433.0       winget
Microsoft Visual C++ 2015-2022 Redistribut… Microsoft.VCRedist.2015+.x64 14.40.33810.0       14.42.34433.0       winget
Opera Stable 115.0.5322.68                  Opera.Opera                  115.0.5322.68       115.0.5322.77       winget
Microsoft Teams                             Microsoft.Teams              24135.300.2876.2873 24295.605.3225.8804 winget
Dev Home                                    Microsoft.DevHome            0.1900.687.0        0.1901.687.0        winget
14 upgrades available.
PS C:\Users\ubuys>
The Name column on the left of course names the package. The ID column contains the ID you must use if you want to upgrade individual packages. The two version columns show the version you have installed and the version that's available. The source column shows where the new package will come from. At the moment all packages come from winget but the tool allows for other repositories to be included in the future.

You can see that I have upgrades available for 14 packages.

Let's start by just upgrading a single package and I'll use the 7-Zip app to show that. Remember, you need to use the ID shown above (7zip.7zip) when identifying packages to winget, so the command I'll use is winget upgrade --id 7zip.7zip....
Code:
PS C:\Users\ubuys> winget upgrade --id 7zip.7zip
Found 7-Zip [7zip.7zip] Version 24.09
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://7-zip.org/a/7z2409-x64.exe
  ██████████████████████████████  1.56 MB / 1.56 MB
Successfully verified installer hash
Starting package install...
The installer will request to run as administrator, expect a prompt.
Successfully installed
It took a minute or two to download the new package and about as long again to install it. But that's it, job done!
 

ubuysa

The BSOD Doctor
There probably isn't a lot of point using winget to upgrade just one package, where it becomes really useful is that it can upgrade all packages with updates in one go. After upgrading 7-Zip then, I had 13 packages with updates...
Code:
PS C:\WINDOWS\system32> winget upgrade
Name                                        Id                           Version             Available           Source
-----------------------------------------------------------------------------------------------------------------------
Audacity 3.6.1                              Audacity.Audacity            3.6.1               3.7.0               winget
CPUID HWMonitor 1.53                        CPUID.HWMonitor              1.53                1.55                winget
TeamViewer                                  TeamViewer.TeamViewer        15.53.6             15.60.3             winget
VLC media player                            VideoLAN.VLC                 3.0.20              3.0.21              winget
calibre 64bit                               calibre.calibre              7.9.0               7.22.0              winget
Bonjour                                     Apple.Bonjour                3.0.0.10            3.1.0.1             winget
Microsoft Edge                              Microsoft.Edge               131.0.2903.70       131.0.2903.86       winget
SyncBackPro x64                             2BrightSparks.SyncBackPro    10.2.147.0          11.3.62.0           winget
Microsoft Visual C++ 2015-2022 Redistribut… Microsoft.VCRedist.2015+.x86 14.40.33810.0       14.42.34433.0       winget
Microsoft Visual C++ 2015-2022 Redistribut… Microsoft.VCRedist.2015+.x64 14.40.33810.0       14.42.34433.0       winget
Opera Stable 115.0.5322.68                  Opera.Opera                  115.0.5322.68       115.0.5322.77       winget
Microsoft Teams                             Microsoft.Teams              24135.300.2876.2873 24295.605.3225.8804 winget
Dev Home                                    Microsoft.DevHome            0.1900.687.0        0.1901.687.0        winget
13 upgrades available.
PS C:\WINDOWS\system32>
All I need to do to upgrade all of those packages is to use the winget upgrade --all command...
Code:
PS C:\WINDOWS\system32> winget upgrade --all
Name                                        Id                           Version             Available           Source
-----------------------------------------------------------------------------------------------------------------------
Audacity 3.6.1                              Audacity.Audacity            3.6.1               3.7.0               winget
CPUID HWMonitor 1.53                        CPUID.HWMonitor              1.53                1.55                winget
TeamViewer                                  TeamViewer.TeamViewer        15.53.6             15.60.3             winget
VLC media player                            VideoLAN.VLC                 3.0.20              3.0.21              winget
calibre 64bit                               calibre.calibre              7.9.0               7.22.0              winget
Bonjour                                     Apple.Bonjour                3.0.0.10            3.1.0.1             winget
Microsoft Edge                              Microsoft.Edge               131.0.2903.70       131.0.2903.86       winget
SyncBackPro x64                             2BrightSparks.SyncBackPro    10.2.147.0          11.3.62.0           winget
Microsoft Visual C++ 2015-2022 Redistribut… Microsoft.VCRedist.2015+.x86 14.40.33810.0       14.42.34433.0       winget
Microsoft Visual C++ 2015-2022 Redistribut… Microsoft.VCRedist.2015+.x64 14.40.33810.0       14.42.34433.0       winget
Opera Stable 115.0.5322.68                  Opera.Opera                  115.0.5322.68       115.0.5322.77       winget
Microsoft Teams                             Microsoft.Teams              24135.300.2876.2873 24295.605.3225.8804 winget
Dev Home                                    Microsoft.DevHome            0.1900.687.0        0.1901.687.0        winget
13 upgrades available.

Installing dependencies:
This package requires the following dependencies:
  - Packages
      Microsoft.VCLibs.Desktop.14 [>= 14.0.24217.0]
      Microsoft.WindowsAppRuntime.1.5
(1/13) Found Audacity [Audacity.Audacity] Version 3.7.0
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://github.com/audacity/audacity/releases/download/Audacity-3.7.0/audacity-win-3.7.0-64bit.exe
  ██████████████████████████████  15.8 MB / 15.8 MB
Successfully verified installer hash
Starting package install...
Successfully installed

(2/13) Found CPUID HWMonitor [CPUID.HWMonitor] Version 1.55
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://download.cpuid.com/hwmonitor/hwmonitor_1.55.exe
  ██████████████████████████████  2.72 MB / 2.72 MB
Successfully verified installer hash
Starting package install...
Successfully installed

(3/13) Found IrfanView [IrfanSkiljan.IrfanView] Version 4.70
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://files02.tchspt.com/down/iview470_x64_setup.exe
  ██████████████████████████████  4.21 MB / 4.21 MB
Successfully verified installer hash
Starting package install...
Successfully installed
I've not shown all the installations, but you see the way it works. Each package is upgraded one after the other, so this is a fire and forget tool.

One key factor to remember if you plan to use winget upgrade --all is to run command prompt/Terminal/PowerShell in Administrator mode. If you forget that then you'll get a UAC prompt for every install - which will soon become tedious.

Summary
I don't see many people using winget to manage packages; listing, validating, exporting, etc. at least not until there is a GUI version available. The winget upgrade option however is very handy, not only for finding upgrades for your packages but also for upgrading them all in one go with the --all option. The only minor negative aspects I have come across are these...
  • Winget uses the default installation options, so for some packages a desktop icon is created, even if you don't want one (and I don't).
  • Winget installs updates for some packages you might not use. I don't use Teams nor Dev Home but winget upgraded them in any case. TBH that's probably sensible so I shouldn't complain.
Give it a go on your system. As long as you have good backups there is nothing to fear. TBH there is little to fear in any case, the updates themselves are those supplied by the app vendors, so winget is just like manually updating the apps.

The Windows Package Manager is going to become my go-to app updating service now. I'm quite impressed.
 
Last edited:

SpyderTracks

We love you Ukraine
We've been using WinGet a lot on corporate domains where the windows store is blocked, WinGet can get through to install available packages (only with admin elevation, end users can't trigger it)

But from that you can export the WinGet installation directory in a script and copy it to a next system:

Code:
winget export -o c:\temp\appslist --accept-source-agreements

This is so powerful as if you're upgrading machines or reinstalling windows, you just load that script and blamo, all your software is as it needs to be from a simple running of a script:

Code:
winget import -i c:\temp\applist --ignore-versions --accept-package-agreements --accept-source-agreements

And then you can set a scheduled task to run a winget upgrade --all say once a week on a Sunday, and your entirely software library is automatically managed from installation through to upgrades.

It really is fantastic. Very much taken from Linux package managers, as with a lot of the windows core, it's moving more and more to a Linux flavor.
 
Last edited:

ubuysa

The BSOD Doctor
One other point that tripped me up. The package manager cannot updates apps that are open. I had the Edge browser open whilst the winget upgrade --all was running and Edge was not updated, though it did update when I closed and restarted it.
 

sck451

MOST VALUED CONTRIBUTOR
Convenient package management is one of the killer features of Linux. Delighted to see it coming to Windows, though I doubt it'll ever be as seamless or convenient...
 

steaky360

Moderator
Moderator
I feel like I'm liable to break something if I mess around with this.... Certainly not something I can do at work (I'm no admin and usually only a reliable bane of our IT department as I'm semi-IT literate).

I guess it isn't likely to knack anything as its only updating packages which are already installed.

As a slight aside, perhaps mostly for my education is this something the owners of said packages need to get onto the windows library (winget must know where to look for true sources of updates for example) or is it pulling from the windows store or another similar MS operated location?
 

Steveyg

MOST VALUED CONTRIBUTOR
I feel like I'm liable to break something if I mess around with this.... Certainly not something I can do at work (I'm no admin and usually only a reliable bane of our IT department as I'm semi-IT literate).

I guess it isn't likely to knack anything as its only updating packages which are already installed.

As a slight aside, perhaps mostly for my education is this something the owners of said packages need to get onto the windows library (winget must know where to look for true sources of updates for example) or is it pulling from the windows store or another similar MS operated location?
I'm on a similar boat, our IT guy tells me I know enough to be dangerous because I'll always try to fix a problem I'm having before giving him a shout. In saying that I fix 99% of issues I might have but there's that very occasional one where I can make a right mess with "fixes"
 
Top