bash:文件:找不到命令


11

我有ubuntu docker容器。我在那里安装了一些在Windows中为ubuntu编译的应用程序。

它不执行,我想检查系统体系结构和文件之间是否不匹配。我尝试这个命令

> file myapp

但不幸的是输出是

> bash: file: command not found

确实,在bin目录中没有“文件”命令。是在其他地方还是我需要安装它?

在此处输入图片说明


5
做一个which file,如果没有结果,那么它不存在安装它..记得你使用docker container它可能没有你所需要的!
乔治·乌德森

1
您是否coreutils已将包装安装在您的容器中?尝试sudo apt-get install coreutils看看结果。
Koala Yeung '02

@KoalaYeung它不在core-utils,包是file
Zanna

@Zanna当程序是核心实用程序时,其结果是否/sbin/file正确?
乔治·乌德森

@George在我看来就像core-utils东西在里面/bin
Zanna

Answers:


21

Docker映像通常只包含基本的内容,似乎创建该容器的人都不认为是file必需的。您必须安装它,该软件包也称为file


1
不要忘记apt-get update之前apt-get install file
费尔南多Fabreti
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.