How to compile Ubuntu from source code?

6,226

There would be little benefit compiling from source. If you are dead set on this then you would probably be better switching do a Linux distribution that is aimed at this sort of user, such as Gentoo. This is designed around the user compiling from source and therefore would suit you better.

Ubuntu is simply a collection of open source tools put together in a way that makes it a good OS for people to use. It is not a single piece of software to be compiled. If you wanted to compile an Ubuntu system from source code you would have to discover all the pieces of software (Kernel, X windows, all other software on top of that) that Ubuntu uses and compile it yourself. Then add all the package management software such as apt on top as well.

Unless there is a good reason to attempt this, I wouldn't bother. As I said before, switch to Gentoo if you want to compile everything yourself, Ubuntu wouldn't be the first choice.

Share:
6,226

Related videos on Youtube

coder
Author by

coder

I am an ubuntu enthusiast.

Updated on September 18, 2022

Comments

  • coder
    coder almost 2 years

    Hello i wanted to know how can get Ubuntu source code and compile it on my own .

    Basically i wanted to give it a try so can some one help me regarding the steps to compile a full Ubuntu system .

    Also would this be beneficial as compared to installing from per-compiled binary?

    • Admin
      Admin over 5 years
      Buildroot is a possibility if you can do with a more minimal OS, see this example: stackoverflow.com/questions/47557262/… that REALLY does compile everything from source. It does not have as many packages as Debian unfortunately.
  • ams
    ams over 12 years
    Even the official Ubuntu doesn't do a full rebuild very often. Individual packages are rebuilt as and when they are updated. As far as I know, it's quite possible that there's a package in the latest release that is years old!
  • macrobook
    macrobook over 12 years
    @ams: I'm not so sure if what you say is true. I think the packages are rebuilt every time there's a new release. This helps since this checks if the package can be built from source (otherwise you have to file a bug tagged "FTBFS" - failed to build from source) [1] en.wikipedia.org/wiki/FTBFS [2] qa.ubuntuwire.org/ftbfs
  • ams
    ams over 12 years
    @medigeek They're built, yes, but they're not re-released, and it's not a full bootstrap rebuild, as far as I know. That is to say, the new builds are discarded as soon as it been shown that they can be rebuilt.
  • Nicolas Raoul
    Nicolas Raoul almost 12 years
    @ams: Do you have a reference for this? Compilers/optimizers are improved quite often (especially for performance). Recompiling allows all executables binaries to benefit from the improvements.
  • ams
    ams almost 12 years
    Here's an example package: launchpad.net/ubuntu/+source/xdot . The exact same package build, albeit copied, is used in Natty and Oneiric, and then it gets an upgrade, but again Precise and Quantal share the same package name, and if it has the same name it's the same package, or else apt-get upgrade wouldn't work.