Javatpoint Logo
Javatpoint Logo

Ubuntu Build Essential

Introduction to Ubuntu Build Essential

The build-essentials packages are the form of meta-packages that are essential to compile software. They contain the GNU/g++ compiler collection, GNU debugger, and a few more libraries and tools that are needed for compiling a program. A few other packages, like GCC, make, G++, dpkg-dev, etc., are also installed on our system when we install the build-essential packages.

GCC (GNU Compiler Collection) is a set of compilers and provides a uniform interface to create programs in Go, Assembler, Ada, Fortran, Objective-C, C, and C++. GNU C Compiler was the actual meaning of GCC, but due to many other languages that have been included since then, this meaning has been modified to GNU Compiler Collection. The C compiler is known as gcc to make it easier to differentiate it from the entire.

The key packages installed on our Ubuntu or Debian system automatically from build-essentials are GCC. The build-essential packages belong to Debian. It's not a part of the software itself. They contain those essential packages as dependencies, so if we install build-essential, we will install each of those packages in a single command.

Note: Don't consider the build-essential package to be a super package that will install every type of development tool from Go to Ruby for us in a single command magically. It contains only a few development tools.

Why would we need a build-essential package?

It's the user to create DEB packages from an application's source code. An average user doesn't go around making DEB packages every day. Although, a few users may utilize the Ubuntu Linux system for application development. We need to have a gcc compiler if we want to execute a C program in Ubuntu. We will need a g++ compiler if we wish to execute C++ programs in Ubuntu.

If we need to use software that's only available through the source code, our system will give an error, i.e., make command not found, as we need to first install the make tool. All of it can be individually installed. However, it's much more convenient to take benefit of the build-essential packages and download each of these development tools at a time.

It's the same as the Ubuntu-restricted-extras package that permits us to install many media codecs at a time. This meta-package contains five different packages that are important to compile software on Ubuntu.

Ubuntu Build Essential
  • g++: It is a GNU compiler for C++ language.
  • gcc: It is a GNU compiler for C language.
  • make: It is a helpful utility that is used to direct the program's compilation. The tool, i.e., make, interprets a file known as "makefile" that can guide the compiler on how to operate.
  • libc6-dev: It is a GNU C library. It includes the header files and development directories used for compiling general C++ and C scripts.
  • dpkg-dev: This package is used to upload, build, and unpack Debian source packages. It is helpful if we wish to package our application for a Debian-based system.

How do we install Essential Packages on Ubuntu?

If we are wondering how we can install essential packages on Ubuntu, we are in luck. The system offers build-essential, which connects to the other packages required to build software. Before we can build software in Ubuntu, we will install the below packages:

  • make
  • GCC
  • G++
  • C Compiler

In the download folder, we can install the packages by double-clicking on the package and enabling the installer to do this work. For instance, for installing a package based on Python, we will need to double-click on it. It will open the file, i.e., installation.deb, and ask us for a password. Also, we can install software with the help of the build-essential meta-package, which includes several other packages. The packages are necessary if we want to compile the programs using the source code and operate with any programming language.

Installation and usage of build-essential on Ubuntu

The build-essential tools can be directly installed using the Ubuntu official repository. They are available in the Ubuntu system repository by default. We need to just install build-essential tool meta-packages from the apt package manager. We need to open our terminal window from the "Ctrl+Alt+T" keyboard shortcut.

Updating apt repository

Now, we need to update our package repository before going to install the build-essential tools. To do so, we will input the below command for updating the apt repository index:


Ubuntu Build Essential

Installing build-essential

We will install the build-essential tools by executing the following command in the terminal window:


Ubuntu Build Essential

After running the above command, the below result will be displayed on the screen:

Checking GCC version

We can verify the installation process of these packages by inspecting the GCC version on our system with the below command once the installation process is completed:

The installed GCC version to be shown on the terminal, which is displayed in the below screenshot:

Every GCC compiler tool and library has been installed on our system. However, we can execute a C program to test the installation.


Next TopicUbuntu Cleaner





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA