如何检查linux是否安装了make
如何检查linux是否安装了make详细介绍
在 Linux 系统里,你可以使用下面的方法来检查是否安装了make:
方法一:使用
which命令
which命令的作用是在系统的PATH环境变量所包含的路径中查找某个可执行文件的位置。要是找到了make,就表明系统已经安装了它。
在终端输入以下命令:
bash
如果系统已经安装了make,命令会输出make的安装路径,例如:
plaintext
/usr/bin/make
要是没有安装,命令则不会有任何输出。
方法二:使用
make -v命令
此命令可以用来查看make的版本信息。要是系统安装了make,运行该命令就会显示make的版本;要是未安装,就会提示命令未找到。
在终端输入以下命令:
bash
若已安装,输出类似如下内容:
plaintext
GNU Make 4.2.1Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
若未安装,会出现类似下面的错误提示:
plaintext
Command 'make' not found, but can be installed with:sudo apt install make
9123Command 'make' not found, but can be installed with:sudo apt install make
这里给出的安装命令会因不同的 Linux 发行版而有所差异。