Intro: Using chocolatey on Windows as Package Manager

Intro: Using chocolatey on Windows as Package Manager

Coming from Linux, managing, installing, and updating programs are a mess compared to the sudo apt update && sudo apt upgrade in Debian or even simpler yay -Syu in Arch. Most of the time, you need to download the .exe or .msi from their own website, which has their own autoupdate methods.

For my specific use case, I need to use VirtualBox 6.1, instead of the newest 7.0. Yes, I can download it here, but with chocolatey I can use Linux-like command, choco install virtualbox --version=6.1.50 to get the latest 6.1 version.

Installing chocolatey to lift up your ego

Here's how. Why is this header so frickin big?

You can head over this page on the exact how-to and explanation

Installing Chocolatey
Chocolatey is software management automation for Windows that wraps installers, executables, zips, and scripts into compiled packages. Chocolatey integrates w/SCCM, Puppet, Chef, etc. Chocolatey is trusted by businesses to manage software deployments.

But in essence, you need to run Powershell with administrator right. Search for Powershell, and hold down Ctrl+Shift and click Powershell. It should prompt you with Administrator rights and password if you use regular user. Click Yes, and enter the following command:

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

Again, read more on the Chocolatey page to understand what this command do. DO NOT blindly copy-paste command from the internet.

Afterwards, you can type choco and it should print-out something similar:

PS C:\Users\User> choco
Chocolatey v2.3.0
Please run 'choco -?' or 'choco <command> -?' for help menu.

Quick Command List to Use chocolatey

💡
Use Powershell (or Terminal) with Administrative privilege everytime you run chocolatey

choco install <package name>
Usually you can find your program here:

Packages
Chocolatey is software management automation for Windows that wraps installers, executables, zips, and scripts into compiled packages. Chocolatey integrates w/SCCM, Puppet, Chef, etc. Chocolatey is trusted by businesses to manage software deployments.

Or you can try choco search <package name> and see your luck.

choco upgrade all
Upgrade all packages installed by chocolatey in one single command

choco uninstall <package name>
Uninstall specific package

choco list
Unsure of the package name? Or just want to see all the packages you have installed? Run this command

choco pin
Pin specific packages to specific version. Useful if you have cases like me when the tasks you are running is broken with the newer version. choco pin -? to understand the options available. As an example, here's my command to pin VirtualBox choco pin add --name="virtual-box" --version="6.1.50" --reason="'reasons available in business editions only'"

Windows Terminal

choco install microsoft-windows-terminal

Firefox

choco install firefox

Python3

choco install python3
Fun-fact, running python in Windows will redirect you to Windows Store. Run python3 instead after installation.

Notepad++

choco install notepadplusplus
Notepad, but infinitely better with syntax highlighting. Try it.

There are more programs out there, but I'm just recommending the open-source one. Truthfully, it is easier to find popular open-source program on chocolatey, but installing Google Chrome, Adobe Acrobat, or even Zoom can be a breeze in Chocolatey with their single centralised upgrade utilities.

Conclusion

Ultimately, for those who are used to using Windows, using chocolatey might be more a hassle than it is worth. But personally, having tasted the freedom of Linux, it's a reminder of the things that can be done better, until I have another chance to install and daily-drive Linux again.

But again, experimenting is always fun right?