translated

This commit is contained in:
geekpi 2021-05-31 08:53:02 +08:00
parent 78e38bfa4b
commit fcdbb9340f
2 changed files with 80 additions and 80 deletions

View File

@ -1,80 +0,0 @@
[#]: subject: (Make Command Not Found? Heres How to Fix it)
[#]: via: (https://itsfoss.com/make-command-not-found-ubuntu/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Make Command Not Found? Heres How to Fix it
======
The other day I was trying to compile a program on a fresh new Ubuntu system and it threw me an error when I tried to use the make command:
```
The program 'make' is currently not installed. You can install it by typing:
sudo apt install make
```
This is an indication that the make command is not installed. You may install make on Ubuntu using these commands one by one:
```
sudo apt update
sudo apt install make
```
The first command updates the local package cache. It is necessary specially if it is a freshly installed Ubuntu system. With the refreshed package cache, your system would know about the repository from where make package should be downloaded.
And verify that make has been properly installed:
```
make --version
```
![Checking make version][1]
### A better way to install make on Ubuntu
An even better way to install make command is to use the build essential package. This package contains make, gcc, g++ and several other compilers and developer tools.
```
sudo apt install build-essential
```
![Installing Build Essential package][2]
With this build-essential package installed, you can [easily run C/C++ programs in Linux][3].
### What if make is installed but it doesnt work
In some rare cases, it may happen that make is installed and yet it doesnt work.
The reason is that make command is not in the $PATH variable. You can either reinstall make with this command:
```
sudo apt install --reinstall make
```
If that doesnt work, you may try to [manually add the binary to your PATH][4] but it shouldnt come to this manual effort.
I hope this quick tip helped you. Still have the problem or question on the related topic? Feel free to use the comment section. Ill try to help you in my capacity. If you want an even more rapid response, you may [join Its FOSS Community forum][5]. Enjoy :)
--------------------------------------------------------------------------------
via: https://itsfoss.com/make-command-not-found-ubuntu/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/check-make-version-linux.png?resize=800%2C293&ssl=1
[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/install-build-essentials-800x410.png?resize=800%2C410&ssl=1
[3]: https://itsfoss.com/c-plus-plus-ubuntu/
[4]: https://itsfoss.com/add-directory-to-path-linux/
[5]: https://itsfoss.community/

View File

@ -0,0 +1,80 @@
[#]: subject: (Make Command Not Found? Heres How to Fix it)
[#]: via: (https://itsfoss.com/make-command-not-found-ubuntu/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Make 命令未找到?这里是如何修复它
======
有一天,我试图在一个新的 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
```
![Checking make version][1]
### 在 Ubuntu 上安装 make 的更好方法
安装 make 命令的一个更好的方法是使用 build-essential 包。这个包包含 make、gcc、g++ 和其他一些编译器和开发工具。
```
sudo apt install build-essential
```
![Installing Build Essential package][2]
安装了这个 build-essential 包后,你就可以[在 Linux 中轻松地运行 C/C++ 程序][3]。
### 如果 make 已经安装了,但它没有工作怎么办?
在一些罕见的情况下,可能会发生 make 已经安装了,但却无法工作的情况。
其原因是 make 命令不在 $PATH 变量中。你可以用这个命令重新安装 make
```
sudo apt install --reinstall make
```
如果这不起作用,你可以尝试[手动添加二进制文件到你的 PATH 中][4],但这应该不需要手动。
我希望这个快速提示能帮助你。仍然有问题或对相关主题有疑问?请随时在评论区留言。我将在我的能力范围内尽力帮助你。如果你想得到更快速的回应,你可以[加入 It's FOSS 社区论坛][5]。祝你愉快 :)
--------------------------------------------------------------------------------
via: https://itsfoss.com/make-command-not-found-ubuntu/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/check-make-version-linux.png?resize=800%2C293&ssl=1
[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/install-build-essentials-800x410.png?resize=800%2C410&ssl=1
[3]: https://itsfoss.com/c-plus-plus-ubuntu/
[4]: https://itsfoss.com/add-directory-to-path-linux/
[5]: https://itsfoss.community/