Use the Windows package manager winget to install, uninstall, and update software

What is Windows Package Manager?

Winget is a command-line tool and a system package management tool for automatically installing, upgrading and configuring software in Windows systems.

Windows Package Manager is a comprehensive package manager solution consisting of a command-line tool and a set of services for installing applications. To use Windows Package Manager, you need to be running at least Windows 10 (version 1809 or later).

Install and uninstall software using the Windows package manager

Usually we install software by going to the official website of a certain software to download and then install and update. The operation is a bit complicated. If there are many software to be installed, the operation is cumbersome and time-consuming. A lot of convenience, but generally the software version is low, or the update is not timely, or you just can't find the software you want.

Since the Windows package manager is available, we can install and uninstall software directly through the winget command.

Find software to install

There are a lot of software in the Windows package manager, which we can directly call and install on the computer. Of course, if we want to know what software we can install, we need to search the software repository to obtain the software name and software ID.

Open a Command Prompt session, PowerShell session, or Windows Terminal window, and type the following command:

winget search

At this point, a list of all installable software will be displayed. Due to the large number of software, the list will continue to scroll down.

insert image description here

Because there are too many software listed, we need to narrow the search scope to the software to be installed, you can directly search for the name of the software to be installed

  • Search keywords: Python
winget search python

insert image description here

At this point, all the software related to the python keyword is listed. We can determine that the keyword related to python in the ID name is python.python, and we will refine the keyword and narrow it down.

winget search python.python

insert image description here

install software

At this time, the package manager lists the software IDs we really need to install. Since there are many versions of Python, choose the version we need to install, such aspython3.10

winget install Python.Python.3.10

After the package management starts to download from the third-party platform, you need to manually click Confirm to start the automatic installation. After the installation is complete, the environment variables will be automatically configured.

insert image description here
After configuring the environment variable, you need to reopen a command window to take effect, check that the environment variable is configured correctly.

insert image description here

uninstall software

The specific version number was entered when python was installed, but it will not be recognized when it is uninstalled, so you only need to enter python

winget uninstall python

insert image description here

update software

We can check which software needs to be updated with the following command

winget upgrade

insert image description here

  • Update individual software

In the above example we can see the software installed, the version installed and the latest version available to install

Copy the software id to be updated, we enter the following command

winget upgrade vim.vim

Some software needs to be uninstalled before installing the latest version, which can be installed after winget uninstalluninstalling .

  • Update all software
    To update all software to the latest version, run the following command:
winget upgrade --all

Guess you like

Origin blog.csdn.net/no1xium/article/details/130931086