MINGW64 bash: wget: command not found

8

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...).

Mithril

Posted 2016-05-11T03:27:13.240

Reputation: 617

1http://mingw-w64.org/doku.php/download: includes wget in the Windows download. – DavidPostill – 2016-05-11T13:38:20.613

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 – 2016-05-12T00:55:55.577

Just use Cygwin. It has everything you need all from one place ;) – DavidPostill – 2016-05-12T07:34:28.367

Answers

6

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.

Arek Kostrzeba

Posted 2016-05-11T03:27:13.240

Reputation: 161

1Please 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 – 2016-11-16T23:04:52.627

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.

daniel martinez

Posted 2016-05-11T03:27:13.240

Reputation: 11

This actually worked. Kudos! – NelsonGon – 2019-06-14T16:59:08.267

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

Shtefan

Posted 2016-05-11T03:27:13.240

Reputation: 1