简体   繁体   English

“进行安装”错误。 make (e=2) 系统找不到指定的文件

[英]"make install" error. make (e=2) The system can not find the file specified

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我已经用巧克力和 docker 安装了 make 工具,我正在尝试构建 linuxkit 工具https://github.com/linuxkit/linuxkit然后使用它为 Docker 构建 linux VM 映像

From the README: "LinuxKit uses the linuxkit tool for building, pushing and running VM images.来自自述文件: “LinuxKit 使用 linuxkit 工具来构建、推送和运行 VM 映像。

Simple build instructions: use make to build.简单构建说明:使用 make 构建。 This will build the tool in bin/."这将在 bin/ 中构建工具。”

I run make install but again and again, whatever I do it keeps failing我运行make install但一次又一次,无论我做什么,它总是失败

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:在 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.我尝试更改 makefile,因为 Windows 上没有 usr/local/bin 这样的路径,但无论我将其更改为什么,构建都不会成功。

I've even tried running it on wsl:我什至尝试在 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.但错误再次出现在第 78 行。

Please, help.请帮忙。

EDIT:编辑:

I've encountered an error on linux as well我在 linux 上也遇到了错误

With docker engine installed and daemon running:安装 docker 引擎并运行守护进程:

tim@tim-vm:~/Desktop/linuxkit/linuxkit-1.0.1$ sudo make
make -C ./src/cmd/linuxkit
make[1]: Entering directory '/home/tim/Desktop/linuxkit/linuxkit-1.0.1/src/cmd/linuxkit'
fatal: not a git repository (or any of the parent directories): .git
tar cf - -C . . | docker run --rm --net=none --log-driver=none -i -e GOARCH= linuxkit/go-compile:7b1f5a37d2a93cd4a9aa2a87db264d8145944006 --package github.com/linuxkit/linuxkit/src/cmd/linuxkit --ldflags "-X github.com/linuxkit/linuxkit/src/cmd/linuxkit/version.GitCommit= -X github.com/linuxkit/linuxkit/src/cmd/linuxkit/version.Version="v0.8+"" -o linuxkit > tmp_linuxkit_bin.tar
gofmt...
vendor/github.com/Code-Hex/vz/v3/internal/objc/finalizer_118.go:8:18: expected '(', found '['
vendor/github.com/moby/buildkit/frontend/attest/sbom.go:75:13: expected '(', found '['
vendor/github.com/moby/buildkit/frontend/frontend.go:15:28: expected ';', found '['
vendor/github.com/moby/buildkit/frontend/gateway/client/client.go:17:28: expected ';', found '['
vendor/github.com/moby/buildkit/solver/result/result.go:16:15: expected ']', found any
vendor/github.com/moby/buildkit/solver/result/result.go:26:2: expected declaration, found 'if'
vendor/github.com/moby/buildkit/solver/result/result.go:68:3: expected declaration, found 'return'
vendor/github.com/moby/buildkit/solver/result/result.go:91:2: expected declaration, found 'if'
govet...
golint...
./cache/write.go:357:1: exported method Provider.ImageInCache should have comment or be unexported
sh: exported: unknown operand
make[1]: *** [Makefile:40: tmp_linuxkit_bin.tar] Error 2
make[1]: *** Deleting file 'tmp_linuxkit_bin.tar'
make[1]: Leaving directory '/home/tim/Desktop/linuxkit/linuxkit-1.0.1/src/cmd/linuxkit'
make: *** [Makefile:61: linuxkit] Error 2

While tweaking makefile file on windows I have encountered a similar problem.在 windows 上调整 makefile 文件时,我遇到了类似的问题。

As you can see, the script creates a.tar file but instantly deletes it.如您所见,该脚本创建了一个 .tar 文件,但立即将其删除。

I will re-iterate that main goal is to run linux Docker containers on Windows, and as I've read LinuxKit would build specific.iso images for using with Hyper-V that would provide more efficiency such as a faster startup and less CPU and memory overhead compared to a regular Hyper-V machine.我将重申主要目标是在 Windows 上运行 linux Docker 容器,正如我读到的那样,LinuxKit 将构建 specific.iso 图像以与 Hyper-V 一起使用,这将提供更高的效率,例如更快的启动和更少的 CPU 和与常规 Hyper-V 计算机相比,开销为 memory。

But since I'm having trouble with linuxkit I will have to resort to using regular Hyper-V machine.但是由于我在使用 linuxkit 时遇到问题,我将不得不求助于使用常规的 Hyper-V 机器。

You are feeling frustrated because you're trying to use a project that was created to work on GNU/Linux, on a Windows system.您感到沮丧,因为您正试图在 Windows 系统上使用一个为在 GNU/Linux 上工作而创建的项目。 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. Windows 和 Linux 在几乎所有可以想象的方面都完全不同,一个项目需要付出巨大的努力才能同时处理这两个问题。 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.是因为您试图在 Windows 上运行 Linux 程序cp 。而该程序在 Windows 上不存在。

Then you switched to WSL.然后你切换到 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.我对 WSL 了解不多,但你正在朝着正确的方向前进:WSL 提供了一个类似 Linux 的环境,你可以在其中运行(某些)Linux 风格的程序。

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.现在正在运行 Linux cp ,但它说它正在尝试复制bin目录中的文件,但没有这样的文件。 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.我无法准确解释原因,但只是想清楚一点:Makefile 中的install目标通常会安装您已经构建的文件。 In your example text above, you didn't run a make command that actually builds anything (usually that's just make with no targets).在上面的示例文本中,您没有运行实际构建任何东西的make命令(通常只是没有目标的make )。

So, maybe you can't run make install because there is nothing to install, because you didn't build the code yet.所以,也许您无法运行make install因为没有要安装的东西,因为您还没有构建代码。

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.在我看来,用于构建 Linux 发行版的 linuxkit(仅从名称和描述来看,我对此一无所知)之类的项目几乎肯定不会在 Windows 上运行。甚至可能在 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.您可能需要 go 回到这里的绘图板:要么获得一个单独的系统并在其上安装 GNU/Linux,要么创建一个真正的虚拟机(不仅仅是 WSL)并在那里运行它,或者找到另一个旨在运行的工具在 Windows 上。

The second error that you have encountered on Linux is because the go-compiler container image used in the build is old, and apparently no longer compatible with the actual code.您在 Linux 遇到的第二个错误是因为构建中使用的 go-compiler 容器镜像是旧的,显然不再与实际代码兼容。 The linuxkit/go-compile:7b1f5a37d2a93cd4a9aa2a87db264d8145944006 container uses go 1.16.3. linuxkit/go-compile:7b1f5a37d2a93cd4a9aa2a87db264d8145944006 容器使用 go 1.16.3。 You can update the Makefiles to use a newer version, just get an appropriate one from here: https://hub.docker.com/r/linuxkit/go-compile/tags -- At least at the moment of this writing, linuxkit/go-compile:c97703655e8510b7257ffc57f25e40337b0f0813 (which provides go 1.19.4) seems to work well.您可以更新 Makefile 以使用较新的版本,只需从此处获取合适的版本: https://hub.docker.com/r/linuxkit/go-compile/tags——至少在撰写本文时,linuxkit /go-compile:c97703655e8510b7257ffc57f25e40337b0f0813(提供 go 1.19.4)似乎运行良好。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 "Makefile error make (e=2): 系统找不到指定的文件" - Makefile error make (e=2): The system cannot find the file specified Windows make - make (e=2): 系统找不到指定的文件 - Windows make - make (e=2): The system cannot find the file specified 报错:系统找不到指定的路径 - Make error: The system cannot find the path specified lua.vm.js 构建失败(make (e=2): 系统找不到指定的文件。) - lua.vm.js is failing to build (make (e=2): The system cannot find the file specified.) MinGW Make throw“系统无法找到指定的路径。”错误 - MinGW Make throwing “The system cannot find the path specified.” error 无法在Windows的virutalenv下安装flask — [错误2]系统找不到指定的文件 - falied to install flask under virutalenv on windows — [Error 2] The system cannot find the file specified 使用 pip 安装 lanms 时出现此错误 FileNotFoundError: [WinError 2] 系统找不到指定的文件 - when using pip install lanms getting this error FileNotFoundError: [WinError 2] The system cannot find the file specified WindowsError:错误2系统找不到指定的文件 - WindowsError: Error 2 The system cannot find the file specified 批处理-系统找不到指定的文件 - Batch - system can not find the file specified 在解决方案中部署驱动程序时发生驱动程序测试错误:系统找不到指定的文件 - Driver Testing an error occurred deploying the driver(s) in the solution : The system can not find the file specified
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM