13

Make 命令未找到?这是修复它的方法 | Linux 中国

 4 years ago
source link: https://zhuanlan.zhihu.com/p/377413408
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Make 命令未找到?这是修复它的方法 | Linux 中国

有一天,我试图在一个新的 Ubuntu 系统上编译一个程序,当我试图使用 make 命令时,它向我抛出一个错误

(本文字数:1098,阅读时长大约:1 分钟)

有一天,我试图在一个新的 Ubuntu 系统上编译一个程序,当我试图使用 make 命令时,它向我抛出一个错误:

The program 'make' is currently not installed. You can install it by typing:
sudo apt install make

这表明 make 命令还没有安装。你可以用这些命令在 Ubuntu 上逐步安装 make

sudo apt update
sudo apt install make

第一个命令是更新本地的软件包缓存。如果是一个新安装的 Ubuntu 系统,这是很有必要的。有了刷新的软件包缓存,你的系统就会知道应该从哪个仓库下载 make 包。

并验证 make 是否已经正确安装:

make --version
v2-16a4c923844513fc987b1b109b1865c2_720w.jpg

Checking make version

在 Ubuntu 上安装 make 的更好方法

安装 make 命令的一个更好的方法是使用 build-essential 包。这个包包含 makegccg++ 和其他一些编译器和开发工具。

sudo apt install build-essential

Installing Build Essential package

安装了这个 build-essential 包后,你就可以在 Linux 中轻松地运行 C/C++ 程序

如果 make 已经安装了,但它没有工作怎么办?

在一些罕见的情况下,可能会发生 make 已经安装了,但却无法工作的情况。

其原因是 make 命令不在 $PATH 变量中。你可以用这个命令重新安装 make

sudo apt install --reinstall make

如果这不起作用,你可以尝试 手动添加二进制文件到你的 PATH 中,但这应该不需要手动。

我希望这个快速提示能帮助你。仍然有问题或对相关主题有疑问?请随时在评论区留言。


via: https://itsfoss.com/make-command-not-found-ubuntu/

作者:Abhishek Prakash 选题:lujun9972 译者:geekpi 校对:wxy

本文由 LCTT 原创编译,Linux中国 荣誉推出


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK