I'm running git bash on windows and I'd like to install some of the linux tools I'm familiar with but apt-get, yum, etc don't appear to work. How can I install programs in git bash?
4 Answers
You can use chocolatey or scoop which will allow you to install software from the command line and they do work on git bash. But if you really want linux software you can install windows 10 then the windows linux subsystem which does allow you to use apt-get if you choose Ubuntu over Opensuse.
- 594
You can download the binary exe file from sites that provide windows exe binaries of linux commands and add it to the Git binaries folder (under the path /c/Program\ Files/Git/mingw64/bin). Check this out:
Example:
To install wget and I quote from https://gist.github.com/evanwill/0207876c3243bbb6863e65ec5dc3f058:
- Download the lastest wget binary for windows from eternallybored (they are available as a zip with documentation, or just an exe)
- If you downloaded the zip, extract all (if windows built in zip utility gives an error, use 7-zip).
- Rename the file
wget64.exetowget.exeif necessary.- Move
wget.exeto yourGit\mingw64\bin\.
To download nano:
- Download the Nano binary from Nano win32-support page. You just need the
.exefile, which is namednano-git-0d9a7347243.exe(as of this writing).- Rename the file to
nano.exe, and copy to themingw64\bindirectory.- This version of Nano will not work with Git Bash alone, but can be invoked using
winpty, for example,winpty nano test.txt.As of 2018, recent versions of Git Bash include Nano, so this is unnecessary! Just be sure to choose Nano as your default editor when installing Git for Windows.
You can also consider using cygwin as a unix-like systems emulator on Windows, where a wide variety of binaries can be included upon installation, and can be added later on.
- 61
Git Bash does not seem to have a package manager.
When using Cygwin or MobaXterm (and there may be more derivatives), you actually can use apt-get like it's ubuntu.
- 141
Option #1 - Combination of Git SDK and Git-SCM
First, go Download the Git For Windows SDK, then transfer all the binaries in C:/git-SDK-64/usr/bin to C:/Program Files/Git/usr/bin and then transfer all the files in /etc. Lastly download WGET seperately as mentioned in the above answer.
NOTE: This method is incredibly dodgy and not recomended for multiple reasons. This is only useful if you want to (kinda) get a Linux Enviroment.
Option #2
Just download Git For Windows SDK and use that as an almost complete Linux Enviroment. e OR
Use the Windows Subsystem For Linux a much more rounded up version of a Linux Enviroment than just a shell. This is the best option as it is a complete Linux Enviroment and well mainained by Microsoft
Option #3
The last option is to download MSYSY2 packages. Then unzip it using preferably PeaZip as other Unzipping softwares such as 7-zip don't support the same format. After extraction manually place in files in your Git installation Directory
- 21