Unpacking Software Livestream

Join our monthly Unpacking Software livestream to hear about the latest news, chat and opinion on packaging, software deployment and lifecycle management!

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

Chocolatey Coding Livestream

Join us for the Chocolatey Coding Livestream, where members of our team dive into the heart of open source development by coding live on various Chocolatey projects. Tune in to witness real-time coding, ask questions, and gain insights into the world of package management. Don't miss this opportunity to engage with our team and contribute to the future of Chocolatey!

Learn More

Calling All Chocolatiers! Whipping Up Windows Automation with Chocolatey Central Management

Webinar from
Wednesday, 17 January 2024

We are delighted to announce the release of Chocolatey Central Management v0.12.0, featuring seamless Deployment Plan creation, time-saving duplications, insightful Group Details, an upgraded Dashboard, bug fixes, user interface polishing, and refined documentation. As an added bonus we'll have members of our Solutions Engineering team on-hand to dive into some interesting ways you can leverage the new features available!

Watch On-Demand
Chocolatey Community Coffee Break

Join the Chocolatey Team as we discuss all things Community, what we do, how you can get involved and answer your Chocolatey questions.

Watch The Replays
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

Downloads:

834,123

Downloads of v 20221216.0.0:

10,394

Last Update:

16 Dec 2022

Package Maintainer(s):

Software Author(s):

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

Tags:

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

MSYS2

This is not the latest version of MSYS2 available.

  • 1
  • 2
  • 3

20221216.0.0 | Updated: 16 Dec 2022

Downloads:

834,123

Downloads of v 20221216.0.0:

10,394

Maintainer(s):

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

Details

Scan Testing Successful:

No detections found in any package files

Details
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:

NOTE

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

1. Enter Your Internal Repository Url

(this should look similar to https://community.chocolatey.org/api/v2/)


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 https://community.chocolatey.org/api/v2/. 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'" 
$exitCode = $LASTEXITCODE

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

Exit $exitCode

- name: Install msys2
  win_chocolatey:
    name: msys2
    version: '20221216.0.0'
    source: INTERNAL REPO URL
    state: present

See docs at https://docs.ansible.com/ansible/latest/modules/win_chocolatey_module.html.


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

See docs at https://docs.chef.io/resource_chocolatey_package.html.


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

Requires cChoco DSC Resource. See docs at https://github.com/chocolatey/cChoco.


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

Requires Puppet Chocolatey Provider module. See docs at https://forge.puppet.com/puppetlabs/chocolatey.


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.

Description

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"

Notes

  • 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.

legal\VERIFICATION.txt
 
legal\LICENSE.txt
 
legal\COPYING.txt
 
tools\msys2-base-x86_64-20221216.tar.xz
md5: 2E8E0F731E0A3E16F9C922F6EE65E2C5 | sha1: 919B44849F246FAD3C3F500B9A23853522A895BB | sha256: 246177C84F42FDAD0A4EBAD53AF2E0DD6F29B61463D91C52EBD3D0B0D916ECD1 | sha512: 8C85C2EB9CF39367BC380424FCC75A5CC188AB51204A34B8599374FB6B13046CEDFA7E08C28DBF3583C8FB292FE3A5C2B1113F83D4220F93491DD07824ED68F1
tools\helpers.ps1
$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 https://gist.github.com/majkinetor/bd5e9aa8ee6c1f55513cc67b02289fa6
function Invoke-Msys2ShellFirstRun { 
    Write-Host "Invoking first run to setup things like bash profile, gpg etc..."
    Invoke-Msys2Shell    
}

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

    $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."
        return 
    }

    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
}
tools\chocolateyUninstall.ps1
$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
tools\chocolateyinstall.ps1
$ErrorActionPreference = 'Stop'

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

Install-Msys2
Set-Msys2Proxy 
Invoke-Msys2ShellFirstRun
Update-Msys2

if (!$pp.NoPath) { Install-ChocolateyPath $pp.InstallDir }

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 20231026.0.0 15662 Thursday, October 26, 2023 Approved
MSYS2 20230718.0.0 23431 Tuesday, July 18, 2023 Approved
MSYS2 20230526.0.0 15916 Friday, May 26, 2023 Approved
MSYS2 20230318.0.0 22639 Saturday, March 18, 2023 Approved
MSYS2 20230127.0.0 13446 Friday, January 27, 2023 Approved
MSYS2 20221216.0.0 10394 Friday, December 16, 2022 Approved
MSYS2 20220904.0.0 29577 Sunday, September 4, 2022 Approved
MSYS2 20220603.0.0 21028 Friday, June 3, 2022 Approved
MSYS2 20220503.0.0 9641 Tuesday, May 3, 2022 Approved
MSYS2 20220319.0.0 15009 Saturday, March 19, 2022 Approved
MSYS2 20220128.0.0 18198 Friday, January 28, 2022 Approved
MSYS2 20220118.0.0 5558 Wednesday, January 19, 2022 Approved
MSYS2 20211130.0.0 33051 Wednesday, December 1, 2021 Approved
MSYS2 20210604.0.0 80057 Sunday, June 6, 2021 Approved
MSYS2 20210419.0.0 23236 Monday, April 19, 2021 Approved
MSYS2 20210228.0.0 11915 Sunday, February 28, 2021 Approved
MSYS2 20210215.0.0 29660 Tuesday, February 16, 2021 Approved
MSYS2 20210105.0.0 24387 Wednesday, January 6, 2021 Approved
MSYS2 20201109.0.0 22763 Saturday, November 14, 2020 Approved
MSYS2 20200903.0.0 75685 Friday, September 4, 2020 Approved
MSYS2 20200816.0.0 11276 Sunday, August 16, 2020 Approved
MSYS2 20200720.0.0 12835 Tuesday, July 21, 2020 Approved
MSYS2 20200719.0.0 1125 Sunday, July 19, 2020 Approved
MSYS2 20200629.0.0 8408 Tuesday, June 30, 2020 Approved
MSYS2 20200602.0.0 14673 Wednesday, June 3, 2020 Approved
MSYS2 20200522.0.0 7164 Sunday, May 24, 2020 Approved
MSYS2 20190524.0.0.20191030 87213 Wednesday, October 30, 2019 Approved
MSYS2 20180531.0.0 114119 Friday, June 1, 2018 Approved
MSYS2 20161025.0.0 8269 Monday, November 6, 2017 Approved
MSYS2 20160719.1.1 38680 Wednesday, October 12, 2016 Approved
MSYS2 20160719.1.0 777 Monday, October 10, 2016 Approved
MSYS2 20150916.0.1 2470 Sunday, November 22, 2015 Approved
MSYS2 20150916.0.0 487 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