1

Possible Duplicate:
How to change the Ubuntu source code

I'm not very familiar with Ubuntu or Linux, but I'm a programmer, and some people told me that you can just go ahead and modify your system.

So my question is, how do you go on about that? For instance, If I'm interested in modifying the behavior of the button or the desktop icons, or whatever it is:

  • How do I get the source code? I guess I need the package name and download it. But how can I get the package name? Let's say I want the button package, where do I look to get the package name? is there a list on a website or a help file?
  • Once I modify it, how can I replace the original with the new one?

P.S. I had some troubles finding the right tags, feel free to edit them

2 Answers2

3

OK, far too general a question, but roughly...

First you figure out which package supplies the software you want to alter (ubuntu is made up of hundreds of separate software packages and there's a number of different ways to figure out which one supplies each installed program/file) then:

apt-get source <packagename>

This will download the source code and unpack it in a subfolder under the current location.

E.g. if I want to change the behaviour of the Rhythmbox music player:

apt-get source rhythmbox

Edit the source code as you please. How to build and run, debug etc. really depends on the program... language, build system, type of software etc. Mostly, linux software projects all use makefiles. There should also be a variety of README files in the root of each source tree explaining how to handle that particular project.

Once you are happy with your changes, to build a replacement package that you can install, you create a new version and run a command (supplied by installing the devscripts package) to build the installable "deb" files. You will find a "debian" folder in the root of the package source code. Edit the file debian/changelog creating a new entry with a new version number and describing your changes. Now run the command debuild to build a new package.

You can use the PPA system in Ubuntu's Launchpad to create your own software repositories and upload your changed source packages there (using debuild -S then dput to upload the .changes file) to be built automatically for all supported architectures and installable by anybody that wants to add your repository to their list.

There's a lot more to it of course, but that is a typical (and "traditional") workflow. I vaguely recall a project called Ground Control that was trying to make it all more point-and-clicky.

Will Daniels
  • 1,746
2

Ubuntu packages holds the packages for all supported releases (Hardy 8.04 LTS is the oldest system). You can find the source files for any package here. This is the official place to find source files.

Launchpad is a software collaboration platform that provides code hosting and alot more. You can find alot of source code here where people created their own software and alterations to existing software and use it to store changes they made and made public.

As a coder you will understand that it is the source code that you can edit, then build, compile (if it not interpreted) and install into your system. Basically the source code you downloaded has an install file or a read me that explains how to install it (configure, make, make install are things you will see alot) so you edit what you need and then follow the instructions.

Finding the correct package might be taunting. You probably need a better description or an image for anyone to tell you what package you actually need if you want that answered. It is far too broad.

Some resources about building software that will get you started:

https://help.ubuntu.com/community/CompilingSoftware Here is explained what package you need to build. It also has some information about getting source files from git where you can check out sources/ There is also a beginner version of that page here: https://help.ubuntu.com/community/CompilingEasyHowTo

Rinzwind
  • 309,379