A long time ago I used to use FreeBSD with its ports system and after that Gentoo for portage in order to install applications via compiling from source. I did this in order to directly target my system.

Are there any other distros out there which support such a configuration? I seem to remember Slackware having something similar.

  • it is not clear from the question whether the question is about compiling the entire system from source, or compiling individual packages. Also, by distros, do you mean Linux based OSs, all free unix-like OSs, or something else? If your question is confined to free unix-like distributions, then by definition all of them can install packages by compiling them from source, but comparatively few (Gentoo and more obscure relatives like Sourcemage for Linux based OSs) and possibly some of the BSDs (I'm not that familar with them) when it comes to compiling the whole system. Mar 21, 2011 at 9:51
  • All Linux distributions allow you to compile stuff, and you can also build your own binary packages and install those. That is essentially what the distribution packagers do to create new versions of the distribution.
    – vonbrand
    Jan 15, 2013 at 22:03

14 Answers 14


I'm not aware of a complete "build the system from source" tool for Debian, but it does support this in a round-about way via apt-src, which will download and build a package, then install the resulting build.


There are a few distros which support both binary and compiled packages--in theory, Gentoo supports this, but I don't think there are too many binary packages. Arch also supports building from source in addition to binary packages via the Arch Build System (ABS), though I don't have any experience with it.

  • +1 for Arch (though you could give a link to the Arch front page, and maybe the AUR) Aug 10, 2010 at 20:25
  • Gentoo is my favorite distro +1 Aug 10, 2010 at 20:54
  • I would've given more links, but I thought I was required to have more than <x> rep (more than 100 anyway) to add more than 1 link, as that was the case on StackOverflow. I see it's not the case here, so links are added!
    – B.R.
    Aug 10, 2010 at 20:56

Gentoo is your best bet here, what's wrong with using it for your needs?

  • 1
    I'm just a distro geek and enjoy installing and trying out all the different ones. Gentoo was always my fav, but with a wife, kids and a business to run the amount of time I have to spend taking good care of a gentoo install has lowered greatly.
    – mendicant
    Aug 11, 2010 at 20:37

You can also try the old and mighty Linux From Scratch.


Most Linux distros support building packages from the source code. You simply need to install the necessary development packages from the distribution repositories along with any specific requirements of the package you are building. If you are wanting to build the system as close to scratch as possible the Linux from Scratch is the model but you have a greater responsibility for tracking security updates, patches, etc. Arch Linux was the distro I chose because it allows you to build from source and provides the sources for updates and patches, etc. Arch has really good user support and plenty of documentation when it comes to resolving install and configuration issues.


Many RPM-based distros have source RPM packages. Debian and Ubuntu have source debs as well. Are you looking for other distros that are primarily, built-from-source or just distros that have source packages available. If it's the latter, the answer is "many/most" of them.


Some come to mind, that I have personally used: LFS (obviously), SourceMage, and someone made one from LNX-BBC makefiles, I can't find it now. But I consider Debian being good enough to compile packages myself, if I need to.

You should also check the list is given by DistroWatch source-based distros:


If you want to try something a little different, there's GoboLinux and NixOs.

  • Nix is careful about tracking the dependencies, about carefully describing the build process as purely functional things where all the dependencies are explicit. That should give the user more flexibility in combining and tuning things boldly, and having some confidence that the result won't be incorrect. Mar 20, 2011 at 8:59

At ALTLinux, much effort is put into maintaining accurate spec-files for packages and that building the packages is accurately reproducible in the current state of the repository of packages. It is being checked regularly that every package in the repository (called Sisyphus) is rebuildable at the current moment -- a rebuild test status report, the logs of the last rebuild test, per package.

To be sure in accurate reproducibility of package builds, special tools to isolate the build system from the host system are used: hasher and the surrounding build-infrastructure tools (e.g., Building packages with gear).

So, although ALTLinux isn't dedicated to installing your system by building, one can be sure that a package he takes from the repository will be easily rebuildable at his host system, without extra issues that haven't been tracked formally by the spec.

ALTLinux is dedicated to being the source for custom package repositories and distros, which--by the design of ALTLinux build system and associated tools--can be easily customized and rebuilt independently from ALTLinux and safely (i.e., isolated from your host system). So, if one wants to make his own customized distro, ALTLinux Sisyphus can be the base for this distro that will be easy for him to use in his work: Intro into making your own distro (in Russian).

  • Here are some more details about the repo consistency checks done by ALTLinux' girar-builder (the build infrastructure), if someone will be interested (although this is not directly about building per se, rather about maintaining a consistent repo of the resulting packages): stackoverflow.com/questions/1316716/… . Mar 21, 2011 at 9:10

I have compiled Squid in Open SUSE, so that distro supports it.


Yes, you are right, slackware use build scripts to compile packages. There are a lot of them available from http://slackbuild.org/ . There are also templates for new scripts and you can always submit your scripts if you want to.


I don't exactly what you're getting at, but take a look at tinycore. The entire image creation pricess is possible to be made from sources.


A very similar question was recently asked.

My answer to that question is here: How to build all of Debian

Theoretically all distros can be built from source. The details may differ slightly with each distro but the method I listed there is a solid starting point.


Does it have to be Linux, or are other unixes ok?

A complete NetBSD system can be built from source, using their build.sh system. The system you build on doesn't even have to be NetBSD, I've done it from Linux or OS X. The build can produce an installation .iso, so you don't have to play around with bootloaders to get the new OS running.

Once you have the base system built and installed, you can easily install other packages from source using NetBSD's pkgsrc package manager.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .