Linux source code repository

Where do you download Linux source code? [closed]

Say I’m interested in the source for one particular Linux utility, like factor . Where can I find the source code for that utility?

8 Answers 8

You can also find out which package the binary comes from an download that packages source code.

On Debian (and Ubuntu and anything else that’s based on Debian) you do that like this:

$ dpkg -S /usr/bin/factor coreutils: /usr/bin/factor $ apt-get source coreutils

The first command will check which package contains the file you are searching for (use » which factor » to find out which binary is executed when you just type » factor «).

The second command will download and unpack the sources (including the patches applied to build the package) to the current directory, so it should be executed in a dedicated or temporary directory.

I’m pretty sure rpm -based distributions have a similar mechanism, but I don’t know their commands.

Thanks, that’s a good, non-Google option. I know Google will always be there, but for some reason I still like knowing how to live without it.

and went to the bottom and found ‘GNU coreutils 6.10’. So I googled ‘coreutils’ and. found the site joschi just linked to.

Thanks, this (a general explanation of how to find the source for a given program) is what I was after.

That may not be a good idea for all things. Some distributions may have modified the original for their distribution. It may be a better idea to use the package management software that comes with you system (Package management can get source as well as binaries) See ‘Saua’ below.

Читайте также:  Linux log journal clear

To find the package a binary comes from, in rpm based system, you might type:

which will print the package name. Instead, with:

you will get also information on a package, including it’s home page in many cases.

Source rpms also exist, but how to get them depends on the high-level package manager used on top of RPM (yum, urpmi, apt-get4 for rpm, . ).

On most systems, also, /usr/share/doc/ contains some documentation on the program, and the website link is pretty often found somewhere there, maybe in the README.

Usually you’ll find the source code on the website of the program if it is open source. In this case here since factor is part of coreutils.

On Gentoo, simply look in the ebuild you compiled the package with :D.

# which factor /usr/bin/factor # grep '/usr/bin/factor' /var/db/pkg/*/*/CONTENTS /var/db/pkg/sys-apps/coreutils-6.12-r2/CONTENTS:obj /usr/bin/factor 5aaf903daa4345efb11618b3cb47e9a5 1224224574 /var/db/pkg/sys-apps/coreutils-6.12-r2/CONTENTS:obj /usr/lib64/debug/usr/bin/factor.debug 517d965636850633e9b15926dde8c222 1224224575 # cat /var/db/pkg/sys-apps/coreutils-6.12-r2/SRC_URI ftp://alpha.gnu.org/gnu/coreutils/coreutils-6.12.tar.lzma mirror://gnu/coreutils/coreutils-6.12.tar.lzma mirror://gentoo/coreutils-6.12.tar.lzma mirror://gentoo/coreutils-6.12-patches-1.0.tar.lzma http://dev.gentoo.org/~vapier/dist/coreutils-6.12-patches-1.0.tar.lzma # cat /var/db/pkg/sys-apps/coreutils-6.12-r2/HOMEPAGE http://www.gnu.org/software/coreutils/

But of course, the source code is probably still available in /usr/portage/distfiles .

Источник

Where can I find the source code of Ubuntu?

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

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.

5 Answers 5

apt-get source linux-source-3.2.0 
sudo apt-get build-dep $package 
sudo apt-get build-dep abiword apt-get source abiword 

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.

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.

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

  1. http://cdimage.ubuntu.com/releases//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//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.

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Читайте также:  Устройства драйверы устройств linux

License

torvalds/linux

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

…nux/kernel/git/tip/tip Pull x86 CFI fixes from Peter Zijlstra: "Fix kCFI/FineIBT weaknesses The primary bug Alyssa noticed was that with FineIBT enabled function prologues have a spurious ENDBR instruction: __cfi_foo: endbr64 subl $hash, %r10d jz 1f ud2 nop 1: foo: endbr64 _NOSPEC comment

Git stats

Files

Failed to load latest commit information.

README

Linux kernel ============ There are several guides for kernel developers and users. These guides can be rendered in a number of formats, like HTML and PDF. Please read Documentation/admin-guide/README.rst first. In order to build the documentation, use ``make htmldocs`` or ``make pdfdocs``. The formatted documentation can also be read online at: https://www.kernel.org/doc/html/latest/ There are various text files in the Documentation/ subdirectory, several of them using the Restructured Text markup notation. Please read the Documentation/process/changes.rst file, as it contains the requirements for building and running the kernel, and information about the problems which may result by upgrading your kernel.

About

Источник

Оцените статью
Adblock
detector