Home > Net >  "make install" error. make (e=2) The system can not find the file specified
"make install" error. make (e=2) The system can not find the file specified

Time:11-14

I've been searching for a couple of hours already, can't still find the solution, feeling very frustrated.

I've installed make tool with chocolatey and docker, and am trying to build linuxkit tool https://github.com/linuxkit/linuxkit and then using it build linux VM image for Docker

From the README: "LinuxKit uses the linuxkit tool for building, pushing and running VM images.

Simple build instructions: use make to build. This will build the tool in bin/."

I run make install but again and again, whatever I do it keeps failing

PS C:\Users\Tim\Desktop\linuxkit-master\linuxkit-master> make install
cp -R bin/* /usr/local/bin
process_begin: CreateProcess(NULL, cp -R bin/* /usr/local/bin, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [Makefile:78: install] Error 2

In Makefile: 77,78:

install:
    cp -R bin/* $(PREFIX)/bin

I've tried changing makefile because there is no such path as usr/local/bin on Windows, but whatever I change it to, the build never succeeds.

I've even tried running it on wsl:

root@DESKTOP-GF982I3:/mnt/c/users# cd /mnt/c/Users/Tim/Desktop/linuxkit-master/linuxkit-master
root@DESKTOP-GF982I3:/mnt/c/Users/Tim/Desktop/linuxkit-master/linuxkit-master# make install
cp -R bin/* /usr/local/bin
cp: cannot stat 'bin/*': No such file or directory
make: *** [Makefile:78: install] Error 1
root@DESKTOP-GF982I3:/mnt/c/Users/Tim/Desktop/linuxkit-master/linuxkit-master#

But yet again the error is on the 78th line.

Please, help.

CodePudding user response:

You are feeling frustrated because you're trying to use a project that was created to work on GNU/Linux, on a Windows system. That simply will not work. Windows and Linux are completely different in just about every way imaginable and it takes an enormous amount of effort for a project to be able to work on both of them. Most projects don't have the time, energy, or interest to do that.

This error:

process_begin: CreateProcess(NULL, cp -R bin/* /usr/local/bin, ...) failed.

is because you're trying to run the Linux program cp, on Windows. And that program doesn't exist on Windows.

Then you switched to WSL. I don't know much about WSL, but you're moving in the right direction: WSL provides a Linux-like environment that you can run (some) Linux-style programs in.

This error:

cp: cannot stat 'bin/*': No such file or directory

now is running Linux cp, but it's saying that it's trying to copy the files in the bin directory and there are no such files. I can't explain why exactly but just to be clear: the install target in a Makefile usually will install files that you already built. In your example text above, you didn't run a make command that actually builds anything (usually that's just make with no targets).

So, maybe you can't run make install because there is nothing to install, because you didn't build the code yet.

It seems to me that a project like linuxkit (just going from the name and description, I know nothing about it) which is used to build Linux distributions, will almost certainly NOT be something you can run on Windows. Possibly not even in WSL. You should check with the project to see what their requirements are.

You may need to go back to the drawing board here: either get a separate system and install GNU/Linux on it, or create a real virtual machine (not just WSL) and run this there, or find another tool that is designed to run on Windows.

  • Related