0
0
Linux CLIscripting~30 mins

Building from source basics in Linux CLI - Mini Project: Build & Apply

Choose your learning style9 modes available
Building from source basics
📖 Scenario: You want to install a simple program by building it from source code on a Linux system. This is common when you want the latest version or a customized build.We will simulate the steps to prepare, configure, build, and check the output of a source build process using command line commands.
🎯 Goal: Learn the basic commands to build a program from source: unpacking the source, configuring the build, compiling the code, and checking the build output.
📋 What You'll Learn
Use the tar command to unpack a source archive
Use the ./configure script to prepare the build
Use the make command to compile the source
Use the ls command to check the build output files
💡 Why This Matters
🌍 Real World
Building software from source is common when you want the latest features or need to customize the program beyond pre-built packages.
💼 Career
Many IT and developer roles require building and installing software from source to manage dependencies and customize environments.
Progress0 / 4 steps
1
Unpack the source archive
Use the tar command to unpack the source archive named example-1.0.tar.gz in the current directory.
Linux CLI
Need a hint?

The -xzf options tell tar to extract a gzip compressed archive.

2
Run the configure script
Change directory into example-1.0 and run the ./configure script to prepare the build environment.
Linux CLI
Need a hint?

Use cd example-1.0 to enter the source folder, then run ./configure.

3
Compile the source code
Use the make command to compile the source code inside the example-1.0 directory.
Linux CLI
Need a hint?

Simply run make to start compiling after configuration.

4
Check the build output
Use the ls command to list the files in the example-1.0 directory and confirm the build created the executable named example.
Linux CLI
Need a hint?

Run ls and look for the example file in the output.