Post

Package Managers for Windows

Package Managers for Windows

Package Manager for Windows

Package managers are tools that simplify the installation, update, and removal of software packages on a computer system. This is similar to how apps are installed on Android and iOS phones through their respective app stores.

Chocolatey is a popular package manager for Windows that simplifies software management. It is built on top of the NuGet infrastructure, which is widely used in the .NET development community. Chocolatey provides a command-line interface (CLI) and a vast repository of software packages.

Installing Chocolatey

Run the following command in elevated command prompt to install the latest version of chocolatey. Official Docs

1
2
3
4
5
6
@rem install chocolatey, run this script from "Administrator command prompt"  
  
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"  
  
@rem don't wait for manual prompt, proceed without confirmation  
choco feature enable -n=allowGlobalConfirmation

Installing packages using chocolatey

  1. Searching for Packages:
    • Visit the Chocolatey website (https://chocolatey.org/packages) and search for packages using the search bar.
    • Use the Chocolatey CLI with the command: choco search firefox
  2. Installing a Package:
    • To install a package using Chocolatey, use CLI command choco install firefox

Updating packages using chocolatey

  1. Checking for Outdated Packages:
    • To check for outdated packages in Chocolatey, use the following command: choco outdated
    • This command will display a list of installed packages that have newer versions available.
  2. Updating a Package
    • To update a package in Chocolatey, execute the following command: choco upgrade firefox
    • To upgrade all the packages in Chocolatey, Run the following command in elevated command prompt choco upgrade all

Installing Basic Applications

Run the following bash script in elevated command prompt to install basic software’s likes zoom, vscode, 7zip, FireFox, pdf, etc..

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
@rem install base applications on desktops/laptops

@rem install base chocolatey packages
choco install choco-cleaner chocolatey chocolatey-core.extension chocolatey-misc-helpers.extension chocolatey-windowsupdate.extension

@rem install Windows utilities
choco install 7zip.install notepadplusplus notepadplusplus.install greenshot curl Everything microsoft-windows-terminal

@rem install browsers and internet utilities
choco install GoogleChrome Firefox Filezilla

@rem install PDF utilities
choco install pdfsam qpdf sumatrapdf

@rem install graphics/imaging applications
choco install imagemagick.app irfanview irfanviewplugins paint.net vlc

@rem install conferencing applications
choco install webex-meetings zoom zoom-client

@rem install sysadmin apps
choco install putty putty.portable winscp winscp.install

@rem install development apps
choco install heidisql vscode vscode.install

Run the below script to upgrade the above installed packages and delete the shortcuts which are added to the desktop during installation.

1
2
3
4
5
6
7
8
9
@rem Upgrade all applications installed via Chocolatey.
@rem Run this file periodically to keep your system up to date.
choco upgrade all

@rem Delete the new Desktop shortcuts
del c:\users\Public\Desktop\*.lnk

@rem Clean chocolatey cache, needs "choco install choco-cleaner"
\ProgramData\chocolatey\bin\choco-cleaner.bat
This post is licensed under CC BY 4.0 by the author.