- What is build-essential Ubuntu, how to install and use it?
- Installation and use of Build Essential tools on Ubuntu 20.04 system
- Update apt repository
- Install build-essential
- Check GCC version
- Create C program
- Compiling the C program
- Run C program
- Conclusion
- About the author
- Karim Buzdar
- Install build essential tools on Ubuntu 22.04 or 20.04 LTS Linux
- What is Build Essential Package in Ubuntu? How to Install it?
- What is build-essential package in Ubuntu?
- Why would you want to install build-essential package?
- Installing build-essential package in Ubuntu Linux
- Removing build-essential tool from Ubuntu
- How to install build-essential? [duplicate]
- 6 Answers 6
- Что такое build-essentials в Ubuntu, как его установить и использовать?
- Установка и использование инструментов Build Essential в системе Ubuntu 20.04
- Обновить репозиторий apt
- Установить необходимое для сборки
- Проверить версию GCC
- Создать программу на C
- Компиляция программы на C
- Запустите программу C
- Вывод
What is build-essential Ubuntu, how to install and use it?
Above, we have described what the build-essential packages are. In the rest of the article, we will explain how to install and use build-essentials on Ubuntu systems. All terminal commands we have executed on Ubuntu 20.04 system in this article. Let’s dive into the depths!
Installation and use of Build Essential tools on Ubuntu 20.04 system
The build-essential meta-packages can be installed directly from the Ubuntu official repository. These packages are available in the default Ubuntu 20.04 system repository. Just install meta-packages of build-essential tools through the apt package manager. Open the terminal application through the keyboard shortcut ‘Ctrl + Alt + t’.
Update apt repository
Now, you need to update the packages repository before installing the build-essential tools. Type the following command to update the apt repository index:
Install build-essential
Install the build-essential packages by running the below-given command:
After executing the above command, the following result will be shown on the terminal:
Check GCC version
Once the installation is finished, verify the installation of these packages by checking the GCC version on your system with the following command:
The installed version of GCC to be displayed on the terminal, which is also shown in the following screenshot:
Now, all GCC compiler libraries and tools have been installed on Ubuntu 20.04 system. However, you can run a C program for testing the installation.
Create C program
Let’s create a C program by using the nano editor as follows:
Now, add the below-mentioned lines of code in this nano file:
int main ( ) <
printf ( «Test, Program! \n » ) ;
return 0 ;
>
Compiling the C program
Save the above file and make an executable file by using the following command:
Run C program
Now, execute the following command to run the C program:
The following output is shown on the terminal after running the above C program:
Conclusion
We have explained the installation of build-essential tools in this article. We have explored what is build-essential and how to install and use it on Ubuntu 20.04 system. Now, you should have the proper understanding of the build-essential and how to install it on the Ubuntu system. The above commands can also be applied to the older Ubuntu versions. To learn more about these required packages, must visit their official website for a better understanding.
About the author
Karim Buzdar
Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. He blogs at LinuxWays.
Install build essential tools on Ubuntu 22.04 or 20.04 LTS Linux
To compile programs from their source code, we need some tools and libraries available through a single package called on Build essential on Ubuntu 20.04 | 22.04 |18.04 or Debian 11 | 10 base repository. Here we learn how to install it.
Build essential is a name for a package that includes the GCC/g++ compilers and libraries and some other utilities required to compile software written in C and C++.
The Gnu Compiler Collection, GCC for short, is a collection of compilers and offers a uniform interface for creating programs in C, C ++, Objective-C, Fortran, Ada, Assembler and Go.
The original meaning of GCC was GNU C Compiler, but because several other languages have been added since then, the meaning has changed to GNU Compiler Collection. Today the C compiler is called gcc in lower case to make it possible to distinguish it from the whole.
The key packages automatically installed on our Debian or Ubuntu system from Build-essentials are GCC– it is a GNU compile for C Programming; g++ for compiling C++ programming language; libc6-dev – GNU C library; Make – The traditional build system or a tool directs compiler how to work; to pack or unpack a Debian package, utility dpkg-dev is also there.
In short, by setting up build-essential we get all the required tools we need to compile software on Ubuntu/Debian systems.
What is Build Essential Package in Ubuntu? How to Install it?
Brief: This is a quick tip to inform new Ubuntu users about the build-essential package, its usefulness and the installation steps.
Installing build-essential package in Ubuntu is as simple as typing this command in the terminal:
But there are several questions around it that you may want answers to:
- What is build essential package?
- What does it contain?
- Why should you install it (if install at all)?
- How to install it?
- How to remove it?
What is build-essential package in Ubuntu?
The build-essential package actually belongs to Debian. It is not a piece of software in itself. It contains a list of packages that are required to create a Debian package (deb). These packages are libc, gcc, g++, make, dpkg-dev etc. The build-essential package contains those required packages as dependencies, so when you install build-essential, you install all those packages in one single command.
Please do NOT consider build-essential to be a super package that will magically install all kind of development tools from Ruby to Go for you in a single command. It has some development tool but not all.
Why would you want to install build-essential package?
It is used for creating DEB packages from the source code of an application. An average user does not go around creating DEB packages everyday, right?
However, some users may use their Ubuntu Linux system for software development. You want to run c program in Ubuntu, you need gcc compiler. You want to run C++ programs in Ubuntu, you need g++ compiler. If you have to use an unusual software that is only available from the source code, your system will throw make command not found error because you need to install make tool first.
All this can be installed individually, of course. However, it is much easier to take advantage of the build-essential package and install all these development tools at once. That’s the benefit you get.
Now that you know the advantage of this package, let’s see how to install it.
Installing build-essential package in Ubuntu Linux
Open a terminal in Ubuntu by pressing the Ctrl+Alt+T shortcut and enter the following command:
With sudo command, you’ll be asked to enter your account’s password. When you type it, nothing is displayed on the screen. That is fine. That’s how it works in most Linux systems. Type your password blindly and press enter.
» data-medium-file=»https://itsfoss.com/wp-content/uploads/2021/10/apt-update-300×175.png» data-large-file=»https://itsfoss.com/wp-content/uploads/2021/10/apt-update-800×467.png» width=»800″ height=»467″ src=»https://itsfoss.com/wp-content/uploads/2021/10/apt-update-800×467.png» alt=»apt update» data-lazy-srcset=»https://itsfoss.com/wp-content/uploads/2021/10/apt-update-800×467.png 800w, https://itsfoss.com/wp-content/uploads/2021/10/apt-update-300×175.png 300w, https://itsfoss.com/wp-content/uploads/2021/10/apt-update-768×449.png 768w, https://itsfoss.com/wp-content/uploads/2021/10/apt-update.png 921w» data-lazy-sizes=»(max-width: 800px) 100vw, 800px» data-lazy-src=»https://itsfoss.com/wp-content/uploads/2021/10/apt-update-800×467.png?is-pending-load=1″ srcset=»data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7″>
The apt update command refreshes the local package cache. This is essential for a fresh Ubuntu install.
After that, run the following command to install build-essential tool:
It should show all the packages it is going to install. Press Y when asked for confirmation:
» data-medium-file=»https://itsfoss.com/wp-content/uploads/2021/10/install-build-essential-ubuntu-300×163.png» data-large-file=»https://itsfoss.com/wp-content/uploads/2021/10/install-build-essential-ubuntu-800×434.png» width=»800″ height=»434″ src=»https://itsfoss.com/wp-content/uploads/2021/10/install-build-essential-ubuntu-800×434.png» alt=»install build essential ubuntu» data-lazy-srcset=»https://itsfoss.com/wp-content/uploads/2021/10/install-build-essential-ubuntu-800×434.png 800w, https://itsfoss.com/wp-content/uploads/2021/10/install-build-essential-ubuntu-300×163.png 300w, https://itsfoss.com/wp-content/uploads/2021/10/install-build-essential-ubuntu-768×417.png 768w, https://itsfoss.com/wp-content/uploads/2021/10/install-build-essential-ubuntu.png 921w» data-lazy-sizes=»(max-width: 800px) 100vw, 800px» data-lazy-src=»https://itsfoss.com/wp-content/uploads/2021/10/install-build-essential-ubuntu-800×434.png?is-pending-load=1″ srcset=»data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7″>
Wait a bit for the installation to complete. That’s it.
Removing build-essential tool from Ubuntu
Keeping those development tools won’t harm your system. but if you are running low on the disk space, you may consider removing it.
Removing software is easy in Ubuntu thanks to the apt remove command:
It will be a good idea to run the autoremove command to remove the residual dependency packages as well:
You know all the essential about build-essential package now (pun intended). Enjoy it 🙂
Creator of It’s FOSS. An ardent Linux user & open source promoter. Huge fan of classic detective mysteries ranging from Agatha Christie and Sherlock Holmes to Detective Columbo & Ellery Queen. Also a movie buff with a soft corner for film noir.
How to install build-essential? [duplicate]
I am trying to install G++ compiler in Ubuntu 13.10. It told me I needed to install the build-essential package.
I have tried the below code
It gives me this error:
6 Answers 6
Type in the Terminal sudo apt-get install build-essential and then press key TAB instead of pressing ENTER .
Enable main repository in Software & Updates.
Then run these commands in a terminal:
You have to enable the main repository in the /etc/apt/sources.list file.
To accomplish this remove the ‘#’ character in front of the following lines.
Save the file and execute
sudo apt-get update && sudo apt-get install build-essential .
Well, sometimes what happens is that if your first command fails due to some repo not responding or other network issues
Then you may not be able to install build-essential. So always ensure that apt-get update completes successfully. Once update is commpleted, issue:
Now you should be able to install it successfully.
You can also install build essentials from software center
Open it up, and search for «build essential»
These terminal commands should solve your problem:
First remove the Merge List by opening a terminal (Press Ctrl+Alt+T to launch) and run this command:
these command lines are interchangable
the options used are -v verbose
If you are ever unsure about a command line or the options being used always refer to the manual page for the command. These can be accessed on the internet by searching for man and the command for example man rm or you can access the same information by typing exactly the same command in the terminal for example man rm instructions for quitting the page will be at the bottom of the terminal like this
picture of man page options
Next, generate a new one by running a simple update:
Что такое build-essentials в Ubuntu, как его установить и использовать?
Главное меню » Ubuntu » Что такое build-essentials в Ubuntu, как его установить и использовать?
Выше мы описали, что такое пакеты, необходимые для сборки. В оставшейся части статьи мы объясним, как установить и использовать необходимые компоненты для сборки в системах Ubuntu. Все команды терминала, которые мы выполнили в системе Ubuntu 20.04 в этой статье.
Установка и использование инструментов Build Essential в системе Ubuntu 20.04
Мета-пакеты, необходимые для сборки, можно установить прямо из официального репозитория Ubuntu. Эти пакеты доступны в системном репозитории Ubuntu 20.04 по умолчанию. Просто установите метапакеты необходимых для сборки инструментов через менеджер пакетов apt. Откройте приложение терминала с помощью сочетания клавиш Ctrl+Alt+t.
Обновить репозиторий apt
Теперь вам нужно обновить репозиторий пакетов перед установкой необходимых для сборки инструментов. Введите следующую команду, чтобы обновить индекс репозитория apt:
Установить необходимое для сборки
Установите пакеты, необходимые для сборки, выполнив следующую команду:
Проверить версию GCC
После завершения установки проверьте установку этих пакетов, проверив версию GCC в вашей системе с помощью следующей команды:
Установленная версия GCC будет отображаться на терминале, что также показано на следующем снимке экрана:
Теперь все библиотеки и инструменты компилятора GCC установлены в системе Ubuntu 20.04. Однако вы можете запустить программу на языке C для тестирования установки.
Создать программу на C
Давайте создадим программу на C с помощью редактора nano следующим образом:
Теперь добавьте в этот файл следующие строки кода:
Компиляция программы на C
Сохраните указанный выше файл и создайте исполняемый файл, используя следующую команду:
Запустите программу C
Теперь выполните следующую команду, чтобы запустить программу C:
Следующий вывод отображается на терминале после выполнения указанной выше программы на языке C:
Вывод
В этой статье мы объяснили установку необходимых для сборки инструментов. Мы изучили, что необходимо для сборки, и как установить и использовать его в системе Ubuntu 20.04. Теперь у вас должно быть правильное представление о том, что необходимо для сборки, и о том, как ее установить в системе Ubuntu. Вышеупомянутые команды также могут применяться к более старым версиям Ubuntu. Чтобы узнать больше об этих необходимых пакетах, необходимо посетить их официальный веб-сайт для лучшего понимания.
Если вы нашли ошибку, пожалуйста, выделите фрагмент текста и нажмите Ctrl+Enter.