Install gnu make on linux

How to Install Make on Ubuntu 22.04

Make is a command-line utility that helps Linux users to download and install packages using their source code. The make utility breaks down the large files into smaller pieces and finds out whether the components are compiled or not, and if not, then it compiles them.

This write-up explains the installation method of the make utility on Ubuntu Jammy Jellyfish.

  • How to Install Make on Ubuntu 22.04?
  • Alternative Installation Method
  • How to Use the Make on Ubuntu 22.04?
  • How to Remove the Make on Ubuntu 22.04?

How to Install Make on Ubuntu 22.04?

Most of the time, when you install Ubuntu, the make utility has already been installed on Ubuntu, so we can confirm this by displaying the installed version of the Make utility with the command:

The output shows that the make utility is not installed on the system. First, update all the packages of Ubuntu:

To install the make utility on Ubuntu, run the below-mentioned command in the terminal of Ubuntu:

When the package of make utility has been installed, a directory with the name “make” is created in “/usr/bin/” which can be displayed by using the command:

The make directory confirms the installation of the make utility on Ubuntu.

Alternative Installation Method

You can also install the make utility by installing the “build-essential” package, and the build-essential contains different packages which help build the packages on Ubuntu. To install the build-essential package, use the command:

$ sudo apt install build-essential -y

How to Use the Make on Ubuntu 22.04?

We can use the make command to install different packages using their source code, and to explain this; we will install SQLite3 on Ubuntu using the make command. For this, first, we have to download its Linux binaries:

$ wget -c https://www.sqlite.org/2022/sqlite-autoconf-3400000.tar.gz

After downloading the Linux binaries of the SQLite3, make a directory with the name of “SQLite3” and navigate to it:

$ mkdir SQLite3 && cd SQLite3

Now in the new directory, extract all the Linux binaries:

$ tar xvfz ../sqlite-autoconf-3400000.tar.gz

Now, navigate to the extracted folder of SQLite and start the configuration:

$ cd sqlite-autoconf-3400000 && ./configure

Compile the configured files and start the installation as well with the make command:

Читайте также:  Установка zip linux centos

For the confirmation of the installation of SQLite3, we will run the command:

How to Remove the Make on Ubuntu 22.04?

If there is no use for the make utility, then it’s better to remove it. The make utility can be removed from Ubuntu using the “purge” option of the apt package manager:

The package has been removed with its configuration files on Ubuntu.

Conclusion

In Ubuntu, the make utility can be installed by executing the command “sudo apt install make -y”. This utility is quite helpful in compiling/linking the source code to get the specific package on Linux. Alternatively, the users can install the make package using the command “sudo apt install build-essential”. All these installation methods are explained in this post.

Источник

How to Install make command on Ubuntu 20.04 LTS (Focal Fossa)

How to Install make command on Ubuntu 20.04 LTS (Focal Fossa) 1

In this article, I will take you through the steps to install make command on Ubuntu 20.04 LTS. GNU make is a free and open source utility to compile and link a program. It requires a Makefile to know how to compile and link a program. It is widely used by programmers and developers to compile their programs on Linux/Unix based systems across the globe.

make utility plays an important role when you have to compile a larger program which has number of source code files. Instead of compiling and linking every program manually, you can simply write a Makefile to compile and build the programs using make utility. It saves lot of time and effort. It is also very easy to install in almost all the famous Linux and Unix distributions. Here we will see the steps to install make utility on Ubuntu 20.04 LTS based systems.

How to Install make command on Ubuntu 20.04 LTS (Focal Fossa)

How to Install make command on Ubuntu 20.04 LTS (Focal Fossa)

Step 1: Prerequisites

a) You should have a running Ubuntu 20.04 LTS Server.

b) You should have sudo or root access to run privileged commands.

c) You should have apt utility available in your System.

Step 2: Update Your Server

In the first step, you need to check for any latest available updates and then install it by using sudo apt update && sudo apt upgrade command as shown below.

cyberithub@ubuntu:~$ sudo apt update && sudo apt upgrade Hit:1 https://dl.google.com/linux/chrome/deb stable InRelease Hit:2 http://in.archive.ubuntu.com/ubuntu focal InRelease Get:3 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB] Hit:4 http://in.archive.ubuntu.com/ubuntu focal-updates InRelease Hit:5 http://in.archive.ubuntu.com/ubuntu focal-backports InRelease Fetched 114 kB in 2s (73.8 kB/s) Reading package lists. Done Building dependency tree Reading state information. Done All packages are up to date. Reading package lists. Done Building dependency tree Reading state information. Done Calculating upgrade. Done The following packages were automatically installed and are no longer required: gir1.2-goa-1.0 libfwupdplugin1 libllvm11 libxmlb1 Use 'sudo apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Step 3: Install make command

In the next step you can install make utility from default Ubuntu repo by using sudo apt install make command as shown below. This will download and install the package along with all its dependencies.

cyberithub@ubuntu:~$ sudo apt install make [sudo] password for cyberithub: Reading package lists. Done Building dependency tree Reading state information. Done The following packages were automatically installed and are no longer required: libfwupdplugin1 libllvm11 libxmlb1 Use 'sudo apt autoremove' to remove them. Suggested packages: make-doc The following NEW packages will be installed: make 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 162 kB of archives. After this operation, 393 kB of additional disk space will be used. Get:1 http://in.archive.ubuntu.com/ubuntu focal/main amd64 make amd64 4.2.1-1.2 [162 kB] Fetched 162 kB in 1s (122 kB/s) Selecting previously unselected package make. (Reading database . 196300 files and directories currently installed.) Preparing to unpack . /make_4.2.1-1.2_amd64.deb . Unpacking make (4.2.1-1.2) . Setting up make (4.2.1-1.2) . Processing triggers for man-db (2.9.1-1) .

Step 4: Verify Installation

After successful installation, you can verify the installed files path by using dpkg -L make command as shown below.

cyberithub@ubuntu:~$ dpkg -L make /. /usr /usr/bin /usr/bin/make /usr/bin/make-first-existing-target /usr/include /usr/include/gnumake.h /usr/share /usr/share/doc /usr/share/doc/make /usr/share/doc/make/ABOUT-NLS.gz /usr/share/doc/make/AUTHORS /usr/share/doc/make/Explanations.gz /usr/share/doc/make/NEWS.Debian.gz /usr/share/doc/make/NEWS.gz /usr/share/doc/make/README.Debian-Source /usr/share/doc/make/README.customs.gz /usr/share/doc/make/README.gz /usr/share/doc/make/changelog.Debian.gz /usr/share/doc/make/copyright /usr/share/man /usr/share/man/man1 /usr/share/man/man1/make-first-existing-target.1.gz /usr/share/man/man1/make.1.gz

Step 5: Check Version

You can also verify the current installed version by using make —version command as shown below.

cyberithub@ubuntu:~$ make --version GNU Make 4.2.1 Built for x86_64-pc-linux-gnu Copyright (C) 1988-2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

Step 6: Using make command

Now that make command is successfully installed, you can test it by compiling any source code using the Makefile configuration as shown below. You just need to write or use correct Makefile to generate object files by running make command. Below is one of the example where I am compiling the rtl8821cu Wifi USB driver source code using make utility. Similarly, you can also check and verify the utility in your system as well.

cyberithub@ubuntu:~/brektrou/rtl8821CU$ make make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/5.15.0-58-generic/build M=/home/cyberithub/brektrou/rtl8821CU modules make[1]: Entering directory '/usr/src/linux-headers-5.15.0-58-generic' CC [M] /home/cyberithub/brektrou/rtl8821CU/core/rtw_cmd.o CC [M] /home/cyberithub/brektrou/rtl8821CU/core/rtw_security.o CC [M] /home/cyberithub/brektrou/rtl8821CU/core/rtw_debug.o CC [M] /home/cyberithub/brektrou/rtl8821CU/core/rtw_io.o CC [M] /home/cyberithub/brektrou/rtl8821CU/core/rtw_ioctl_query.o CC [M] /home/cyberithub/brektrou/rtl8821CU/core/rtw_ioctl_set.o CC [M] /home/cyberithub/brektrou/rtl8821CU/core/rtw_ieee80211.o CC [M] /home/cyberithub/brektrou/rtl8821CU/core/rtw_mlme.o CC [M] /home/cyberithub/brektrou/rtl8821CU/core/rtw_mlme_ext.o CC [M] /home/cyberithub/brektrou/rtl8821CU/core/rtw_mi.o CC [M] /home/cyberithub/brektrou/rtl8821CU/core/rtw_wlan_util.o .

Step 7: Check all the Available Options

To check more options available with make command, you need to use make —help command as shown below.

cyberithub@ubuntu:~$ make --help Usage: make [options] [target] . Options: -b, -m Ignored for compatibility. -B, --always-make Unconditionally make all targets. -C DIRECTORY, --directory=DIRECTORY Change to DIRECTORY before doing anything. -d Print lots of debugging information. --debug[=FLAGS] Print various types of debugging information. -e, --environment-overrides Environment variables override makefiles. --eval=STRING Evaluate STRING as a makefile statement. -f FILE, --file=FILE, --makefile=FILE Read FILE as a makefile. -h, --help Print this message and exit. -i, --ignore-errors Ignore errors from recipes. .

Источник

Читайте также:  Linux создать fat32 раздел

How to Install and Use Make on Ubuntu 22.04

There are different methods to install packages on Ubuntu, like using the packages from the default repository, using the Debian packages, and downloading the packages from the Snapcraft store. Similar to these methods, one is by installing the application from its source code by compiling it with some utility.

For compiling the source code, there should be some Ubuntu command utility which is “make,” and in this blog, the installation method of the Make command with its usage has been explained.

How to Install and Use Make on Ubuntu 22.04?

The Make utility is pre-installed on the Ubuntu operating system, but if it is not installed, then it can be installed using the command:

To check the version of the installed package of make command utility, run the command:

The GNU Make 4.3 has been successfully installed on Ubuntu and another way to verify the installation of make command utility is by confirming the directory of “make” in the /usr/bin/ directory:

How to use make on Ubuntu 22.04

To use the make command utility on Ubuntu, we are going to install the package of SQLite3 on Ubuntu. First, download the package of SQLite from its official website by using the wget command:

Next step is to make the directory where we will extract the contents of the downloaded package, therefore, we will create the directory with the name of SQLite3 and navigate to the directory using the command:

Extract the contents of the downloaded package by using the command:

Читайте также:  Cannot open display kali linux

When the folder is extracted, then navigate to the SQLite extracted directory and configure all the files using the command:

Once the configuration is done, compile the source code and install it using the make command:

To confirm the installation of the SQLite3 with the make command utility, check the version of the installed package:

Conclusion

With “sudo apt install make -y”, the make command utility can be installed and used to install different packages using their source code on Ubuntu 22.04. In this write-up, the installation method, as well as the usage of the Make command utility, has been explained with the help of an example.

About the author

Hammad Zahid

I’m an Engineering graduate and my passion for IT has brought me to Linux. Now here I’m learning and sharing my knowledge with the world.

Источник

Оцените статью
Adblock
detector