Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

share|improve this question

marked as duplicate by Jorge Castro, Ringtail, Stephen Myall, Thomas W., Javier Rivera Nov 7 '12 at 20:01

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
This is way too general to answer properly, I recommend focusing your question down to exactly what you want to modify. –  Jorge Castro Nov 7 '12 at 2:42
    
@JorgeCastro The answers in the question you've provided me didn't answer my questions, but thank you for mentioning it. How could I be more specific? I read my question a couple of times and it seems to be very clear. –  MasterMastic Nov 7 '12 at 2:44
    
You have the ability of editing your question, please add in there what things in the previous question don't meet your needs, "behavior of the button or the desktop icons" is a start, but not quite enough to enable me to help you. A screenshot or a bit more description outta be enough. –  Jorge Castro Nov 7 '12 at 2:47
1  
Well I agree with Jorge on that we can not tell you what package you need based on what is currently in your question. I do have an answer for you that can be used as a starter but it will -not- answer the question on WHAT package you need. –  Rinzwind Nov 7 '12 at 2:58
1  
The accepted answer of the "How to change the Ubuntu source code" shows how to get the source of a package, but it doesn't show how to build the modified code and replace the original code, so I think if you edit the question to concentrate on this it'll be a good question. –  Sergey Nov 7 '12 at 3:11

2 Answers 2

up vote 3 down vote accepted

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.

share|improve this answer
    
You're awesome, Will! the first link is a treasure as-well as the rest of your answer. Thank you! –  MasterMastic Nov 7 '12 at 3:22
1  
Being new to ubuntu, I recommend reading up on the Debian Filesystem Hierarchy Standard to get an idea of where to find everything in the filesystem. Then you can use dpkg -S /some/file/path command to identify the package that installed whatever (although package contents search from the web page mentioned already is usually just as quick). I forgot to mention also sudo apt-get build-dep rhythmbox would also be needed to install any build dependencies. –  Will Daniels Nov 7 '12 at 3:31

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

share|improve this answer

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