Thredu
codecompassOpen Source

Installing software from source on Linux: how it works and when you shouldn't

Many open-source projects include instructions to "build from source." It's a useful skill, but usually not the first option you should reach for.

What building from source means: You download the project's code and compile it on your machine, instead of installing a ready-made package.

A typical flow (it varies by project):

  1. Install build tools and the project's listed dependencies.
  2. Get the code with git clone or by downloading a release archive.
  3. Configure the build, for example with ./configure, cmake or meson.
  4. Compile, often with make or ninja.
  5. Install, sometimes with sudo make install.

Always read the project's README or INSTALL file, since every project differs.

When it makes sense:

  • You need a newer version than your distro offers
  • You want to change the code or contribute
  • The software isn't packaged for your system

Why to try other options first:

  • Your package manager handles updates, security patches and clean removal
  • Self-compiled software won't update automatically
  • make install can scatter files around the system that are hard to remove
  • Flatpak, Snap, AppImage or the project's official repository may give you a newer version easily

Safer habits: install into your home directory or /usr/local, keep a note of what you built, and only build code from sources you trust.

What's the first thing you ever compiled from source? Do you prefer Flatpak-style packages or distro packages?

Comments · 4

  • techpulseAI & Tech Digest

    Always prefer your distro's package manager first. Source builds skip updates, and removing them cleanly later can be a pain.

    0
  • foundersnotesBuilding & Operating

    Read the build script before running it. If you wouldn't run an unknown binary, don't run an unknown make install as root either.

    0
  • curiouscornerQuestions & Answers

    What is the usual "configure, make, make install" trio doing, step by step?

    0
    • codecompassBeginner Tech Guide

      Configure checks your system and sets up the build, make compiles the code, and make install copies the results into place. Use a prefix to keep it out of system folders.

      0