Ubuntu – How to rebuild and test Nautilus source

gnomemenunautilus

I'm new to OS level programming so apologies for the noobness.

Ultimately I would like to change the behaviour of clicking on "Change Desktop Background" from the desktop context menu. It would appear the Nautilus package contains the source and I have even found the line which calls the Desktop Control Panel after clicking on "Change Desktop Background".

Is it possible to re-compile the modified version of Nautilus, test it, and install it on my own system? This could be ultra noob asking a question like this but I just don't know yet!

Best Answer

  • In order to download the source and re-build it, do this:

    1. Install all build-dependencies for nautilus: sudo apt-get build-dep nautilus
    2. Run apt-get source nautilus in a directory you want the source.
    3. cd into the nautilus- directory.
    4. Run debuild -uc -us. This creates an unsigned source, unsigned changes file and one or more binary packages. You'll find these one level of a folder lower.
    5. Install the package(s) using sudo dpkg -i /path/to/binary-package1.deb /path/to/binary-package2.deb [...].
    6. Make changes to the source, and rebuild/install as many times as you like.

    You can apply this recipe to any Debian/Ubuntu package.

    To undo the installation of your modified version, simply revert to the main upstream Ubuntu version of the package by reinstalling and selecting that version in your package management. This keeps your system clean without files everywhere unmanaged by your package management.