The 'Git for Windows' by default does not come with MSYS2 package manager called 'Pacman' and hence it is a limited version or subset of the MSYS2. Also the bash which supplied wih 'Git for Windows' is not a full version of bash hence does not provide for full Linux environment.
However you can get package manager support inside 'Git for Windows' in following ways :
- Install full MSYS2 and build Git for Windows yourself (Most git users don't require all packages and MSYS2)
- Install Git for Windows SDK (heavy & consumes around 3-5 Gb space)
- Use a hack to merge the MSYS2 Pacman packages with your existing Git for Windows installation
Alternative to Full Install: If you are installing MSYS2 or the Git WindowsSDK then best to use installer. However if you dont want to go for full install then you can try an alternative of obtaining the zipped package here - http://repo.msys2.org/msys/x86_64/
Given below is the easiest method (bullet 3 above) to enable package manager (Pacman) support for an existing Git for Windows installation.
- Install Git for Windows SDK (Require approx 4 GB) or check 'Alternative to Full Install' above.
- Copy ${git-sdk}/usr/bin/pacman.exe to ${git}/usr/bin
- Copy ${git-sdk}/etc/pacman.conf to ${git}/etc
- Copy ${git-sdk}/etc/pacman.d to ${git}/etc
- Copy ${git-sdk}/var to ${git}/
DONE!!! Now you can use Pacman to install new packages from the MSYS2 Repository.
The above worked nicely! One thing: I had to run Git Bash as administrator, for otherwise the copy command would throw an access denied. I do not see any difference in the output of
whoami
orid
when running Git Bash as administrator or not. But alas, when running without admin rights I indeed could not create/var
myself either. So, running as administrator helped.Thanks, @smaug2309, finally
zsh
,whois
andnc
on Windows. (Anddig
andhost
, but not through Pacman.)