TranslateProject/sources/tech/20210526 Make Command Not Found- Here-s How to Fix it.md
2021-05-27 08:49:01 +08:00

3.0 KiB
Raw Blame History

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

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

With this build-essential package installed, you can easily run C/C++ programs in Linux.

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 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. Enjoy :)


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

作者:Abhishek Prakash 选题:lujun9972 译者:译者ID 校对:校对者ID

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