Chocolatey Community Coffee Break

Join the Chocolatey Team on our regular monthly stream where we discuss all things Community, what we do, how you can get involved and answer your Chocolatey questions.

Learn More

Chocolatey Product Spotlight

Join the Chocolatey Team on our regular monthly stream where we put a spotlight on the most recent Chocolatey product releases. You'll have a chance to have your questions answered in a live Ask Me Anything format.

Learn More

Announcing Chocolatey Central Management 0.10.0

Livestream from
Thursday, 06 October 2022

We recently released our largest update to Chocolatey Central Management so far. Join Gary and Steph to find out more about Chocolatey Central Management and the new features and fixes we've added to this release.

Watch On-Demand
Chocolatey and Intune Overview

Webinar Replay from
Wednesday, 30 March 2022

At Chocolatey Software we strive for simple, and teaching others. Let us teach you just how simple it could be to keep your 3rd party applications updated across your devices, all with Intune!

Watch On-Demand
Chocolatey For Business. In Azure. In One Click.

Livestream from
Thursday, 9 June 2022

Join James and Josh to show you how you can get the Chocolatey For Business recommended infrastructure and workflow, created, in Azure, in around 20 minutes.

Watch On-Demand
The Future of Chocolatey CLI

Livestream from
Thursday, 04 August 2022

Join Paul and Gary to hear more about the plans for the Chocolatey CLI in the not so distant future. We'll talk about some cool new features, long term asks from Customers and Community and how you can get involved!

Watch On-Demand
Hacktoberfest Tuesdays 2022

Livestreams from
October 2022

For Hacktoberfest, Chocolatey ran a livestream every Tuesday! Re-watch Cory, James, Gary, and Rain as they share knowledge on how to contribute to open-source projects such as Chocolatey CLI.

Watch On-Demand
Chocolatey Product Spotlight: Chocolatey 1.2.0 and Chocolatey Licensed Extension 5.0.0

Livestream from
Thursday, 03 November 2022

Join Paul and Gary for this months Chocolatey product livestream where we look at the latest release of Chocolatey 1.2.0, Chocolatey Licensed Extension 5.0.0 and shine a spotlight on the new hook scripts functionality. This opens up so many possibilities for Chocolatey CLI users!

Watch On-Demand
Chocolatey Coding Livestream

Livestream from
Tuesday, 29 November 2022

Join Josh as he adds the ability to manage Chocolatey GUI config and features with the Chocolatey Ansible Collection.

Watch On-Demand
Introduction into Chocolatey with Veeam

Webinar from
Tuesday, 13 December 2022

Join Gary, Paul, and Maurice as they introduce and demonstrate how to use Chocolatey! Questions will be answered live in an Ask Me Anything format.

Watch On-Demand



Downloads of v 20221216.0.0:


Last Update:

16 Dec 2022

Package Maintainer(s):

Software Author(s):

  • Alexpux
  • martell
  • mingwandroid
  • elieux
  • renatosilva
  • niXman


msys2 msys cygwin mingw gnu linux unix posix arch pacman bash makepkg gcc shell cli foss development


This is not the latest version of MSYS2 available.

  • 1
  • 2
  • 3

20221216.0.0 | Updated: 16 Dec 2022



Downloads of v 20221216.0.0:



Software Author(s):

  • Alexpux
  • martell
  • mingwandroid
  • elieux
  • renatosilva
  • niXman

MSYS2 20221216.0.0

This is not the latest version of MSYS2 available.

  • 1
  • 2
  • 3

All Checks are Passing

3 Passing Tests

Validation Testing Passed

Verification Testing Passed


Scan Testing Successful:

No detections found in any package files

Learn More

Deployment Method: Individual Install, Upgrade, & Uninstall

To install MSYS2, run the following command from the command line or from PowerShell:


To upgrade MSYS2, run the following command from the command line or from PowerShell:


To uninstall MSYS2, run the following command from the command line or from PowerShell:


Deployment Method:


This applies to both open source and commercial editions of Chocolatey.

1. Enter Your Internal Repository Url

(this should look similar to

2. Setup Your Environment

1. Ensure you are set for organizational deployment

Please see the organizational deployment guide

2. Get the package into your environment

  • Open Source or Commercial:
    • Proxy Repository - Create a proxy nuget repository on Nexus, Artifactory Pro, or a proxy Chocolatey repository on ProGet. Point your upstream to Packages cache on first access automatically. Make sure your choco clients are using your proxy repository as a source and NOT the default community repository. See source command for more information.
    • You can also just download the package and push it to a repository Download

3. Copy Your Script

choco upgrade msys2 -y --source="'INTERNAL REPO URL'" --version="'20221216.0.0'" [other options]

See options you can pass to upgrade.

See best practices for scripting.

Add this to a PowerShell script or use a Batch script with tools and in places where you are calling directly to Chocolatey. If you are integrating, keep in mind enhanced exit codes.

If you do use a PowerShell script, use the following to ensure bad exit codes are shown as failures:

choco upgrade msys2 -y --source="'INTERNAL REPO URL'" --version="'20221216.0.0'" 

Write-Verbose "Exit code was $exitCode"
$validExitCodes = @(0, 1605, 1614, 1641, 3010)
if ($validExitCodes -contains $exitCode) {
  Exit 0

Exit $exitCode

- name: Install msys2
    name: msys2
    version: '20221216.0.0'
    state: present

See docs at

chocolatey_package 'msys2' do
  action    :install
  source   'INTERNAL REPO URL'
  version  '20221216.0.0'

See docs at

cChocoPackageInstaller msys2
    Name     = "msys2"
    Version  = "20221216.0.0"
    Source   = "INTERNAL REPO URL"

Requires cChoco DSC Resource. See docs at

package { 'msys2':
  ensure   => '20221216.0.0',
  provider => 'chocolatey',
  source   => 'INTERNAL REPO URL',

Requires Puppet Chocolatey Provider module. See docs at

4. If applicable - Chocolatey configuration/installation

See infrastructure management matrix for Chocolatey configuration elements and examples.

Package Approved

This package was approved as a trusted package on 16 Dec 2022.


MSYS2 is a software distro and building platform for Windows.

At its core is an independent rewrite of MSYS, based on modern Cygwin (POSIX compatibility layer) and MinGW-w64 with the aim of better interoperability with native Windows software. It provides a bash shell, Autotools, revision control systems and the like for building native Windows applications using MinGW-w64 toolchains.

It features a package management system to provide easy installation of packages, Pacman. It brings many powerful features such as dependency resolution and simple complete system upgrades, as well as straight-forward package building.

Ruby integration

This package can be used with ruby package to provide native building environment for gems.

  • The ruby installer comes with ridk function which offers interactive GUI installation wizard of msys2 and hence can't be used unattended (ridk install 1).
  • Its system update is the same as initialization done with this package (ridk install 2).
  • Ruby installer offers unattended setup of MSYS2 and MINGW development toolchain (ridk install 3).

You can also just install the msys2 package without system update and use ridk afterwards:

cinst ruby                        # install ruby
cinst msys2 --params "/NoUpdate"  # install msys2 without system update
Update-SessionEnvironment         # refresh environment vars
ridk install 2 3                  # use ruby's ridk to update the system and install development toolchain

Package parameters

  • /InstallDir - Path to installation directory, by default msys will be installed in Get-ToolsLocation.
  • /NoPath - Do not add msys installation directory to system PATH.
  • /NoUpdate - Do not automatically update with Pacman according to the official instructions.

Example: choco install msys2 --params "/NoUpdate /InstallDir:C:\your\install\path"


  • MSYS2 itself will not be installed again on updating or reinstalling the Chocolatey package. Instead, the existing MSYS2 will be updated with Pacman. Manually delete the installation folder to force complete reinstallation.
  • If the package is out of date please check Version History for the latest submitted version. If you have a question, please ask it in Chocolatey Community Package Discussions or raise an issue on the Chocolatey Community Packages Repository if you have problems with the package. Disqus comments will generally not be responded to.

$ErrorActionPreference = 'Stop'

$toolsPath = Split-Path $MyInvocation.MyCommand.Definition
. $toolsPath/helpers.ps1


if (!$pp.NoPath) { Install-ChocolateyPath $pp.InstallDir }
$ErrorActionPreference = 'Stop'

$toolsDir = Split-Path $MyInvocation.MyCommand.Definition

$pp = Import-Clixml $toolsDir\pp.xml
if (!$pp.NoPath)  { 
    $user_path = [System.Environment]::GetEnvironmentVariable('PATH',  'User')
    $newPath = $user_path.Replace(";" + $pp.InstallDir, '')
    if ($newPath -ne $user_path) { 
        Write-Host "Removing from user PATH"
        [System.Environment]::SetEnvironmentVariable('PATH', $newPath, 'User')

Write-Host "Please remove install dir manually when you don't need it anymore."
Write-Host "Install dir: " $pp.InstallDir
$pp = Get-PackageParameters

$is64 = (Get-OSArchitectureWidth 64) -and $env:chocolateyForceX86 -ne 'true'
$dir_name = if ($is64) { 'msys64' } else { 'msys32' }
if (!$pp.InstallDir) { $pp.InstallDir = "{0}\{1}" -f (Get-ToolsLocation), $dir_name  }
$pp | Export-Clixml $toolsPath\pp.xml
$InstallPath = $pp.InstallDir

function Invoke-Msys2Shell($Arguments) {
    if (![string]::IsNullOrWhiteSpace($Arguments)) { $Arguments += "; " }
    $Arguments += "ps -ef | grep '[?]' | awk '{print `$2}' | xargs -r kill"

    $params = @{
        FilePath     = Join-Path $InstallPath msys2_shell.cmd
        NoNewWindow  = $true
        Wait         = $true
        ArgumentList = "-defterm", "-no-start", "-c", "`"$Arguments`""
    Write-Host "Invoking msys2 shell command:" $params.ArgumentList
    Start-Process @params

#  For full expected output see
function Invoke-Msys2ShellFirstRun { 
    Write-Host "Invoking first run to setup things like bash profile, gpg etc..."

function Update-MSys2 {
    if ($pp.NoUpdate) {
        Write-Host "Skipping updates due to the 'NoUpdate' option"    

    $logPath      = Join-Path $InstallPath update.log
    $stopSentence = 'there is nothing to do'
    $cntSentence  = 2
    $shellArgs    = "pacman --noconfirm -Syuu --disable-download-timeout | tee -a /update.log"
    $max          = 5  

    Write-Host "Repeating system update until there are no more updates or max $max iterations"
    Write-Host "Output is recorded in: $logPath"

    Remove-Item $logPath -ea 0
    $ErrorActionPreference = 'Continue'     #otherwise bash warnings will exit
    while (!$done) {
        Write-Host "`n================= SYSTEM UPDATE $((++$i)) =================`n"
        Invoke-Msys2Shell $shellArgs
        $done = (Get-Content $logPath) -match $stopSentence | Measure-Object | ForEach-Object { $_.Count -ge $cntSentence }
        $done = $done -or ($i -ge $max)

# requires $pp.InstallDir & toolsPath in upper scope
function Install-Msys2 {
    if (Test-Path $InstallPath) { 
        Write-Host "'$InstallPath' already exists and will only be updated."

    Write-Host "Installing to:" $InstallPath
    $packageArgs = @{
        PackageName    = $Env:ChocolateyPackageName
        FileFullPath   = Get-Item $ToolsPath\*-i686*
        FileFullPath64 = Get-Item $ToolsPath\*-x86_64*
        Destination    = $InstallPath
    Get-ChocolateyUnzip @packageArgs
    Remove-Item $ToolsPath\*.xz -ea 0

    $tarFile = Get-Item "$InstallPath\*.tar"
    Get-ChocolateyUnzip $tarFile $InstallPath
    Remove-Item "$InstallPath\*.tar" -ea 0
    $tardir = Get-Item "$InstallPath\msys*"
    if ([String]::IsNullOrWhiteSpace($tardir)) { throw "Can't find msys* directory from tar archive" }
    Move-Item $tardir\* $InstallPath
    Remove-Item $tardir

function Set-Msys2Proxy {
    $proxy = Get-EffectiveProxy
    if (!$proxy) { return }
    Write-Host "Using CLI proxy:" $proxy
    $Env:http_proxy = $Env:https_proxy = $proxy
md5: 2E8E0F731E0A3E16F9C922F6EE65E2C5 | sha1: 919B44849F246FAD3C3F500B9A23853522A895BB | sha256: 246177C84F42FDAD0A4EBAD53AF2E0DD6F29B61463D91C52EBD3D0B0D916ECD1 | sha512: 8C85C2EB9CF39367BC380424FCC75A5CC188AB51204A34B8599374FB6B13046CEDFA7E08C28DBF3583C8FB292FE3A5C2B1113F83D4220F93491DD07824ED68F1

Log in or click on link to see number of positives.

In cases where actual malware is found, the packages are subject to removal. Software sometimes has false positives. Moderators do not necessarily validate the safety of the underlying software, only that a package retrieves software from the official distribution point and/or validate embedded software against official distribution point (where distribution rights allow redistribution).

Chocolatey Pro provides runtime protection from possible malware.

Add to Builder Version Downloads Last Updated Status
MSYS2 20230127.0.0 13202 Friday, January 27, 2023 Approved
MSYS2 20221216.0.0 10345 Friday, December 16, 2022 Approved
MSYS2 20220904.0.0 26488 Sunday, September 4, 2022 Approved
MSYS2 20220603.0.0 20858 Friday, June 3, 2022 Approved
MSYS2 20220503.0.0 9589 Tuesday, May 3, 2022 Approved
MSYS2 20220319.0.0 14919 Saturday, March 19, 2022 Approved
MSYS2 20220128.0.0 18147 Friday, January 28, 2022 Approved
MSYS2 20220118.0.0 5512 Wednesday, January 19, 2022 Approved
MSYS2 20211130.0.0 26227 Wednesday, December 1, 2021 Approved
MSYS2 20210604.0.0 79808 Sunday, June 6, 2021 Approved
MSYS2 20210419.0.0 23170 Monday, April 19, 2021 Approved
MSYS2 20210228.0.0 11858 Sunday, February 28, 2021 Approved
MSYS2 20210215.0.0 29629 Tuesday, February 16, 2021 Approved
MSYS2 20210105.0.0 24342 Wednesday, January 6, 2021 Approved
MSYS2 20201109.0.0 22691 Saturday, November 14, 2020 Approved
MSYS2 20200903.0.0 75538 Friday, September 4, 2020 Approved
MSYS2 20200816.0.0 11237 Sunday, August 16, 2020 Approved
MSYS2 20200720.0.0 12805 Tuesday, July 21, 2020 Approved
MSYS2 20200719.0.0 1097 Sunday, July 19, 2020 Approved
MSYS2 20200629.0.0 8376 Tuesday, June 30, 2020 Approved
MSYS2 20200602.0.0 14636 Wednesday, June 3, 2020 Approved
MSYS2 20200522.0.0 7129 Sunday, May 24, 2020 Approved
MSYS2 20190524.0.0.20191030 87092 Wednesday, October 30, 2019 Approved
MSYS2 20180531.0.0 114043 Friday, June 1, 2018 Approved
MSYS2 20161025.0.0 8216 Monday, November 6, 2017 Approved
MSYS2 20160719.1.1 38577 Wednesday, October 12, 2016 Approved
MSYS2 20160719.1.0 728 Monday, October 10, 2016 Approved
MSYS2 20150916.0.1 2408 Sunday, November 22, 2015 Approved
MSYS2 20150916.0.0 446 Sunday, September 27, 2015 Approved
Discussion for the MSYS2 Package

Ground Rules:

  • This discussion is only about MSYS2 and the MSYS2 package. If you have feedback for Chocolatey, please contact the Google Group.
  • This discussion will carry over multiple versions. If you have a comment about a particular version, please note that in your comments.
  • The maintainers of this Chocolatey Package will be notified about new comments that are posted to this Disqus thread, however, it is NOT a guarantee that you will get a response. If you do not hear back from the maintainers after posting a message below, please follow up by using the link on the left side of this page or follow this link to contact maintainers. If you still hear nothing back, please follow the package triage process.
  • Tell us what you love about the package or MSYS2, or tell us what needs improvement.
  • Share your experiences with the package, or extra configuration or gotchas that you've found.
  • If you use a url, the comment will be flagged for moderation until you've been whitelisted. Disqus moderated comments are approved on a weekly schedule if not sooner. It could take between 1-5 days for your comment to show up.
comments powered by Disqus