·Publikoval Frank Hliva·4 min čítania

Chocolatey - Package Manager for Windows

Chocolatey - Package Manager for Windows

If you have used alternative operating systems in the past, you are certainly used to the luxury that a package manager provides. All your software is in one place in a single central repository, maintained by the distribution authors. You don’t have to search, download, or manually install anything – you simply type yum install package-name (if you used RHEL, CentOS, Oracle Linux, or Fedora), sudo pacman -S package-name (if you used Arch, Manjaro, ArcoLinux, or Anarchy), or sudo apt install package-name (if you used Debian or Ubuntu). And there is a probability bordering on certainty that no one will ever bundle any malware with the installed software (though never say never). If you are too picky and don’t like typing commands into the console, you can download a GUI frontend (for example, Pamac for pacman).

Windows 10 is increasingly adopting the philosophy of these console-friendly systems. Alongside the fantastic Windows Terminal, it now has its own package manager, Chocolatey – the majority of common applications have their own package in Chocolatey. Microsoft uses its own Windows Store as its primary software distribution channel, which is also a package manager in its own way – albeit a clickable one designed for average users. Chocolatey is aimed more at power users who prefer the keyboard over clicking a mouse… Microsoft uses this channel too. For instance, Windows Terminal appeared first in Chocolatey and only a few days later in the Windows Store. Now let’s demonstrate how to install a package (let’s say Google Chrome):

Note: Before you start installing anything, run your console in administrator mode. How? Right-click the Start icon and then choose Windows PowerShell (Admin): see this image for more details. Some newer packages do not require administrator privileges, but most do.

Type the following in your console (PowerShell or Windows Terminal):

choco install googlechrome

This command installs the current version of Google Chrome. Here are some more examples:

Package / ApplicationNoteCommand
VLC media playerpopular media playerchoco install vlc
.NET CoreMultiplatform FW from MSchoco install dotnetcore
JREJava Runtimechoco install jre8
WhatsAppMessaging app by Facebookchoco install whatsapp
ViberMessaging appchoco install viber
new Edge devMS browser based on Chrome Blink enginechoco install microsoft-edge-insider-dev
7zipexcellent free alternative to WinRARchoco install 7zip.install
Gitdistributed version control systemchoco install git.install
VSCodelightweight editor for developerschoco install vscode
Visual Studio 2019comprehensive development environment supporting C#, F#, C++, Python, Ruby, JSchoco install visualstudio2019community

Or if you don’t feel like typing so much, you can simplify it and install everything at once with a single command:

choco install firefox vlc dotnetcore jre8 whatsapp viber microsoft-edge-insider-dev

And for those who don’t want to type at all, you can download a GUI wrapper for Chocolatey. It is called chocolatey-gui (what a surprise), here is a screenshot and here is the command to install it: choco install chocolateygui. All other packages can be found here: https://chocolatey.org/packages. Personally, I uninstalled my traditionally installed apps and reinstalled them via Chocolatey. The main benefit is that I can manage them all collectively, updating everything with a single command from the console:

choco upgrade all
Chocolatey
Bulk upgrade of installed packages

So I no longer have to manually check for updates… I can also uninstall packages via Chocolatey, even several at once:

choco uninstall notepadplusplus googlechrome atom 7zip

The package manager grew out of NuGet – which is the packaging system for .NET. I just don’t understand why every language and technology has to have its own manager with its own syntax, as I currently have these in Windows:

Package managerNote
Chocolateypackage manager for Windows
OneGetpackage manager for Windows
Windows Storepackage manager for Windows
dotnetpackage manager for .NET Core
NuGetpackage manager for .NET Framework
MSIMicrosoft Installer - older package manager from MS
aptpackage manager for WSL - Ubuntu / Debian
npmdefault package manager for Node.JS
opampackage manager for the functional language OCaml
cargopackage manager for Rust

Essentially, every runtime has its own – e.g., OCaml has Opam, Haskell has Cabal, Rust has Cargo. I don’t understand why they can’t unify them (at least the ones from Microsoft could be unified).

Share:
Späť na blog

Súvisiace čítanie

Ďalšie články z blogu

Zobraziť všetky články
I Love My McDonald's

I Love My McDonald's

Today I was reading through the archive of a very old Slovak newspaper from 1914. It was called Slovenské Noviny and was published in Budapest – few people today realize that more Slovaks lived in Budapest at that time than in the German-speaking Pressburg (Bratislava).

Čítať článok