Blog about a mac person trying linux and windows
In this article I will quickly tell what a package manager is and list common package manager commands that you can use with Winget on Windows, Apt (Apt-Get) on Linux and Homebrew on Mac (an unofficial package manager for Mac). I won’t go through in-depth the differences of the different package manager and how they work in this article. If you need to go back and forth between different package managers or you aren’t familiar with one of the package manager listed here, you might find this article useful.
Those of you that don’t know what a package manager is (especially users from Windows): A package manager allows you to install new apps quickly through command line. So you don’t need to go to every app companies’ web-site to download their apps. Especially if you need to quickly install a lot of apps at once (for example you are reinstalling your computer). It’s also a centered approach to update all your apps. Recently Microsoft has released their own package manager called Winget. It isn’t still yet completely finished, but there’s already more apps available there than in Microsoft Store. You can install the new package manager for example from directly downloading from Microsoft’s github: https://github.com/microsoft/winget-cli/releases
How to search for an app if it is available in your package manager’s repositories:
Install an app:
List all installed apps. For Homebrew, this command will list all apps that you have listed through Homebrew (not the apps that you have installed through other ways). But for example Winget will list all the apps that are installed in your Windows (not just apps through Winget, so you will see for example Windows Updates there also). Because of this it might not be so useful to see quickly, if you have installed some app before. But you can use in “winget list appname”, to see if you have already installed the app or not.
If you don’t want the whole list of all the installed, you can also only list a specific app. For example if you just want to know, if some certain app is installed or not.
# Winget
winget list appname
# Homebrew (formulae)
brew list appname
# Homebrew (cask)
brew list --cask appname
In Apt and in Homebrew you can easily update all your apps at the same time. But first you need to update your package manager’s database (so the package manager knows, if there’s an updates or not). After that you can run the upgrade command to install the updates. The package manager will during upgrade process show which packages will be updated, and you can cancel the update installation at that time, if you for example notice that you need some app to be on certain version.
# Apt update package database
apt update
# (Optional step) Apt list which packages can be upgraded
apt list --upgradeable
# Apt upgrade and install the new updates
apt upgrade
# Homebrew update package database
brew update
# (Optional step) Homebrew: list which packages can be upgraded
brew outdated
# Homebrew upgrade and install the new updates
brew upgrade
You can also upgrade and install an update to a certain app (if for some reason you want to update only one application).
# In Apt upgrade certain package and install the new update
apt --only-upgrade install appname
# In Homebrew upgrade certain package and install the new update
brew upgrade appname
As Winget is still in Beta, it has been reported that it might not be so good idea to upgrade all apps at once through Winget. The problem might be related that Winget itself list all apps that have been installed in your Windows (not just the applications that have been installed through Winget). For this reason, you should use Winget to update only apps that you have installed through Winget and one by one. With the following command you can update a specific app:
To updates all apps in Winget at once, you can run the following command, but as stated before, Winget is currently in Beta and using the following command isn’t recommended: