Cygwin error - Failed to run '/bin/bash': No such file or directory

0

I've just downloaded and installed Cygwin on Windows 7. It seems to have installed successfully, with the C:\Cygwin64 folder comprising 1.2GB of data when the installation folder I installed it from was just under 300MB. However, clicking the desktop shortcut opens mintty.exe, which then displays the error:

Failed to run '/bin/bash': No such file or directory

This is despite the fact I installed all of the base files, of which bash was supposedly part of - and even if it wasn't, the installer later showed it as a required package and installed it itself. So does anyone have any idea what's happening here? This might be my fourth attempt in the last day trying to get a successful install of Cygwin working; I'm starting to think I'm just not meant to have it.

Hashim

Posted 2017-01-29T04:34:11.180

Reputation: 6 967

Navigate to C:\Cygwin64, do you see there a file cygwin.bat ? Try to double click on it and let us know what happened – Alex – 2017-01-29T05:24:34.213

The .bat file was there, but clicking it made cmd flash for a fraction of a second and did nothing else. Still, I've managed to sort this now, as detailed in my answer. Thanks anyway, @Alex. – Hashim – 2017-01-29T05:55:59.630

In your case, where a batch file closes too fast, you can always edit the .bat by adding a PAUSE as a last command. (Sometimes the batch is more complex, containing if, elseif, else branches, so the end of the batch might be somewhere inbetween. In those cases you would need to add a PAUSE within the conditions) – PythoNic – 2020-01-15T17:03:40.210

Answers

0

I managed to sort this with yet another installation - this time I opted to download and install from the net (option 1 in the installer), instead of downloading the files separately and installing from the locally-stored folder (options 2 and 3). I can't be sure why selecting those options was providing me with an incomplete installation, but I'm now able to run bash without errors.

Hashim

Posted 2017-01-29T04:34:11.180

Reputation: 6 967

file base installation is convenient choice when you already setup some cygwin installation and need to spread it across another computers. This way first you download from inet, and installation folder would stuffed full of packages on the end of installation that you can reuse on other computers later. – Alex – 2017-01-29T06:00:40.403

Agreed. Thankfully I didn't need it that urgently, so I can do without it, but it is a shame that it wasn't installing properly that way, could have been useful in the future. – Hashim – 2017-01-29T06:07:42.030

0

I had the same problem after a default fresh install directly from the web.

I solved it by going to "C:\cygwin64\bin" and duplicating "ash.exe" and renaming the copy to "bash.exe".

(I was trying this by pure chance, just because bash was missing and I found this ominous ash file)

CLion

Posted 2017-01-29T04:34:11.180

Reputation: 1