7

I am using git with MINGW64(install by git) on windows. MINGW64 is great, but lack of some command which rarely use on windows. Today, I just have a whim to figure out how to use wget in it.

I found this mingw-w64/wiki2/MSYS, it says The all-in-one package on the MinGW-w64 download page. all-in-one? uh-huh, but I don't see there is anyway to install wget command... And this wiki for mingw32, it has a package manger which can install wget.

I just want something like oneclick install, or visual manager interface(for idiot) to install some command, without complex configuration(complexity make life hard when setup a new dev machine...).

  • 1
    mingw-w64.org/doku.php/download: includes wget in the Windows download. – DavidPostill May 11 '16 at 13:38
  • 1
    @DavidPostill But I want to use MINGW64 in git-bash, I can't figure out how to add wget to it.Install another MINGW64 would mess up enviroment I think. – Mithril May 12 '16 at 0:55
  • Just use Cygwin. It has everything you need all from one place ;) – DavidPostill May 12 '16 at 7:34
5

This will be helpfull article.

https://gist.github.com/evanwill/0207876c3243bbb6863e65ec5dc3f058

The basic idea is that C:\Program Files\Git\mingw64\ is your / directory according to Git Bash (note: depending on how you installed it, the directory might be different. from the start menu, right click on the Git Bash icon and open file location. It might be something like C:\Users\name\AppData\Local\Programs\Git, the mingw64 in this directory is your root). If you go to that directory, you will find the typical linux root folder structure (bin, etc, lib and so on). If you are missing a utility, such as wget, track down a binary for windows and copy the files to the corrisponding directories. Sometimes the windows binary have funny prefixes, so you should rename the exe file to the standard name. Since bin is on the PATH, it will be automatically available to Git Bash.

It isn't easy. You have to find, download and copy to any global directory tools compiled for Windows environment (*.exe files like wget.exe) You can copy them to C:\Program Files\Git\mingw64\bin or any other directory listed in your system or user PATH variable to have global acccess to these files.

  • 1
    Please quote the essential parts of the answer from the reference link(s), as the answer can become invalid if the linked page(s) change. – DavidPostill Nov 16 '16 at 23:04
1

Download the wget.exe file from your source, ie eternallybored

Then you downlaod and extract the Zip to a folder, in my case I keep all my resources in c:\Tools so I extracted it to C:\Tools\wget\ and then you should create a user variable for the exe.

So open start menu and search variables, open the link for "Edit System Environment Variables" and add a new user variable (I called it "WGET_HOME" and its value the directory "C:\Tools\wget" ).

Finally select the "PATH" variable and append to the list follwoing a ";" "%WGET_HOME%" and OK your way back.

Then after closing all open MinGW you will be able to use wget.

  • This actually worked. Kudos! – NelsonGon Jun 14 at 16:59
0

Install Cygwin and get the needed application from there. Then you can add Cygwin bin directory into MINGW64 PATH. Something like that:

MINGW64$wget

bash: wget: command not found

MINGW64$export PATH=$PATH:/c/cygwin/bin/

MINGW64$wget --version
GNU Wget 1.18 built on cygwin.

Or simply copy the needed binary into any suitable directory you can find or add in $PATH

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.