67

I would like to know where to find the source code of Ubuntu. I'd like to see how far it is "open source".

  • 29
    And it's completely open-source. No need to be skeptical about it... – notablytipsy Jul 24 '12 at 14:09
  • 2
    All source is open for all of the source code files. – Anwar Aug 9 '12 at 8:53
  • 2
    Despite being "open" there are things called binary blobs in the kernel as far as I'm aware. It's open, but not decipherable in some places. – AER Apr 15 at 8:05
55
  1. Linux Kernel Source Code:

    apt-get source linux-source-3.2.0
    

    Where can I find the source code for the Ubuntu Kernel?

  2. Ubuntu Source Code:

    Ubuntu archive

  3. Specific Software Source Code:

    sudo apt-get build-dep $package
    

    where package is the program/package's source code you want to adopt.

    then type:

    apt-get source $package
    

    to get the source for that package.

    For instance:

    sudo apt-get build-dep abiword
    apt-get source abiword
    
| improve this answer | |
14

The source code for every package in the main and universe archives is in Launchpad, or you can get it by enabling Sources in the Software Properties dialog, and then doing apt-get source $packagename in a terminal, after refreshing the package information.

Source code for packages in the partner repositories is not generally available, as they are mostly not open source applications. This is true for some items available in the Software Center as well.

| improve this answer | |
10

Software in linux distributions is organized into packages. Each package either contains user facing software like Firefox, or libraries like libasound2 which is required by firefox. If you install Firefox, the apt system will figure out what prerequisite packages exist, will download and install them. Now, these packages are generally distributed as binary files that have already been compiled for a given processor architecture, but the exact source used to compile that version of a package is available via apt-get source firefox.

The vast majority of things in Ubuntu's repositories of packages are open source. But Ubuntu does have a list of approved proprietary software. While this software doesn't satisfy the freedom goals of Ubuntu, they are greatly desired by the community, and provide a lot of value. Examples of this are Skype or Sun Java (now removed). These packages are not listed on the Ubuntu packages site.

| improve this answer | |
  • very good rundown of the sw context – zipizap Jul 24 '12 at 16:12
9

You can download the complete source code ISOs from the Ubuntu download servers:

  1. http://cdimage.ubuntu.com/releases/<version>/release/source/ for currently-supported releases. For example, http://cdimage.ubuntu.com/releases/12.04/release/source/ for 12.04.
  2. http://old-releases.ubuntu.com/releases/<version>/release/source/ for obsolete/EOL releases. For example, http://old-releases.ubuntu.com/releases/12.10/source/ for 12.10. However, source ISOs seem to be available only for 12.10 onwards.
| improve this answer | |
1

bzr

Get the latest version of package hello (includes next unreleased one):

bzr branch lp:ubuntu/hello

Get specific version:

bzr branch lp:ubuntu/trusty/hello

Now you can for instance to:

bzr log

to see the development history, or any similar SCM operation.

bzr is a good option as it maintains the actual input Ubuntu developers give to Ubuntu, so it is a more canonical (no pun intended) source.

Launchpad bzr browsing

You can also browse the repositories on the Launchpad.

For the hello package, visit: https://code.launchpad.net/ubuntu/+source/hello

Now choose the Ubuntu version that interests you, e.g.: https://code.launchpad.net/~ubuntu-branches/ubuntu/trusty/hello/trusty

Then if you click on "Browse the code" you will go to: https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/hello/trusty/files where you can browse the files and commit history.

This is powered by Loggerhead.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.