In the world of software installation, many Linux users experience the advantage of package managers like apt-get, pacman, or yum. These programs significantly simplify the installation, updating, and uninstallation of software by utilizing central package sources and automatically managing dependencies. For a long time, there was no comparable solution from Microsoft for Windows users. However, in recent years, Microsoft has caught up with their own solution, offering Windows users the convenience of a package manager. In this blog post, I will explore the functionality and advantage of package managers, introduce some package managers, and explain why Winget on Windows is particularly interesting for Windows users.
What are Package Managers and What Advantage Do They Offer?
Package managers are programs that simplify the installation, updating, and uninstallation of software. Instead of downloading and installing each application individually from the manufacturer’s website, software can be installed from a central repository using a package manager.
This offers several advantages:
- Convenience: Installation is done with a simple command instead of manually downloading installation files and going through the installation process.
- Updating: Package managers automatically keep your software up to date by searching for updates and installing them, ensuring your computer is always supplied with the latest security and feature patches.
- Dependency Management: Many software programs require other programs to function (called dependencies). Package managers automatically handle the installation of these dependencies, so you don’t have to worry about them.
- Reproducibility: With a package manager, the exact configuration of the software can easily be replicated on another computer by simply installing the required packages.
- Security: Most package managers verify the integrity of downloaded packages to ensure they have not been tampered with. This protects against malware and other security threats.
Popular Package Managers for Different Operating Systems
- Linux: apt-get, pacman, yum, dnf
- macOS: Homebrew
- Windows: Winget, Chocolatey
Winget: The Official Package Manager for Windows
Winget is Microsoft’s official package manager, introduced in 2020. It offers several advantages over other package managers for Windows:
- Officially from Microsoft: Winget is developed and maintained by Microsoft, meaning it is stable and secure.
- Integrated with Windows: Winget is already integrated into Windows 10 and 11, so users don’t need to install Winget separately.
- Wide Selection of Packages: Winget has a constantly growing collection of packages, including both well-known open-source software and commercial applications.
- Easy to Use: Winget uses a simple command-line interface that is easy to learn and use.
Using and Installing Winget
Using Winget is straightforward. To get started, open the command prompt and enter the command winget
followed by the desired action.
For example:
- To install a package, use the command
winget install <package name>
. - To update a package, use the command
winget update <package name>
. - To uninstall a package, use the command
winget uninstall <package name>
.
Microsoft provides a complete list of available commands and options in the official Winget documentation: Use the winget tool to install and manage applications | Microsoft Learn
Automated Installation of Winget Packages with a PowerShell Script
If you want to further automate the use of Winget, you can use a PowerShell script. Here’s an example: I have created a GitHub repository where I have published a PowerShell script that automatically installs all the Winget packages I need when setting up my computer.
You can find the repository here: Niklashere/Useful-Tools: Some useful tools to make my own life easier. (github.com)
The script allows me to quickly and easily install my preferred applications on any Windows system by simply running the script.
How to Use the Script:
- Download the script from the repository or clone it to your local computer.
- Open PowerShell as an administrator.
- Navigate to the location of the downloaded script.
- Run the script with the command
.\installer.ps1
.
The script will then install all the Winget packages specified in the script without requiring you to enter each command individually. You can also customize the script to include or exclude your own preferred packages.
A Graphical User Interface for Winget
WingetUI is an optional graphical user interface for Winget, which allows you to search, install, update, and uninstall packages without having to enter command-line commands.
WingetUI can be installed using the command winget install Some.PythonThings.WingetUIStore
.
Installing Winget
Winget is included by default in Windows 10 and 11. If Winget is not already installed, it needs to be installed from the Microsoft Store.
You can find the link to the official Microsoft Store page here: Microsoft Store – App Installer
Conclusion
Package managers like Winget offer Windows users a range of benefits, simplifying and securing the installation, updating, and uninstallation of software.
Especially for Windows users who have not had experience with package managers before, Winget is an excellent choice. The easy installation, wide selection of packages, and integration with Windows make it a user-friendly and powerful tool for software management.