Sunday, February 27, 2022

[SOLVED] Package management in Git for Windows (Git Bash)?

Issue

I'm reading the github wiki for git-for-windows and it says that msys2 bundles pacman: rel="noreferrer">https://github.com/git-for-windows/git/wiki/Package-management

But when I invoke it I get:

$ pacman
bash: pacman: command not found

Does anyone have an idea what is going on?

Which git version does this wiki refer to?

Is there a way to install additional packages to msys2 inside Git for windows?


Solution

As mentioned in issue 397:

This is intended. We do not ship pacman with Git for Windows.
If you are interested in a fully fledged package manager maintained environment you have to give the Git for Windows SDK a try.

The bash that you see in the latest git for Windows (2.5.3), which is a more recent bash than the old msysgit one, is only there to execute git commands.
It is not a full-fledged linux environment to install any third-party package.


Warning: dhj reports in the comments

Do not link your existing git for windows with the msys2 main system by using a directory junction.
If you uninstall it will decide that linked directory belongs to it and DELETE YOUR ENTIRE HOME DIRECTORY including sub-directories like "Downloads".
Beware dealing with msys2.

I don't know if the same is true for the git for windows SDK, but BE CAREFUL trying to get pacman from other systems integrated with git for windows.



Answered By - VonC
Answer Checked By - Katrina (WPSolving Volunteer)