Skip to content

Instantly share code, notes, and snippets.

@bonkmaykrQ
Last active July 12, 2025 18:58
Show Gist options
  • Save bonkmaykrQ/adea511fe7796d53e75f56547ae38d0c to your computer and use it in GitHub Desktop.
Save bonkmaykrQ/adea511fe7796d53e75f56547ae38d0c to your computer and use it in GitHub Desktop.
MSYS2 Package Install for Linux

MSYS2 package installer for Linux MINGW

This is a very unimpressive bash script I wrote to automatically dump tarball URLs from the MSYS2 pacman repos you copy from your web browser, and put them in your MINGW prefix.

I made this because I hate using Windows but I also am incredibly disappointed in how fucking annoying dependency management is on Linux MINGW - Linux distributions do not make a good enough effort to provide dedicated MSYS2 packages (because they are only needed by a very small minority).

You still have to track down dependencies yourself but at least each installation is just a single Ctrl+V. So yeah, enjoy.

#!/bin/sh
## Pass the file URL of a mingw-w64 package as an argument to this script
## and it will install it to your Linux system's mingw prefix automatically.
## Errors are normal - the script tries both 32-bit and 64-bit packages.
## You will need to either run this script as root or be a sudoer!
wget $@
tar --zstd -xvf $(basename $@)
sudo cp -r ./mingw32/* /usr/i686-w64-mingw32/
sudo cp -r ./mingw64/* /usr/x86_64-w64-mingw32/
rm -r ./mingw32/
rm -r ./mingw64/
rm .BUILDINFO
rm .MTREE
rm .PKGINFO
rm $(basename $@)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment