Debian and Ubuntu packages make it easy to hack on software that's packaged and try out your changes, within the framework of the packaging system. These instructions assume that you have an understanding of how Debian packaging works, although all you really need to know is that each file in the distribution comes from a package, which contains the compiled form of a source package.
Figure out what package the software is from. Usually it's named
approximately the same as the software itself, e.g., barnowl
or gdb
or libwww-mechanize-ruby
. You can use the command dpkg -S
to figure
out where a file comes from, or search on
packages.debian.org or
packages.ubuntu.com.
Type apt-get source
followed by the package name. This will
download the source package.
cd into the directory that was just created and make whatever changes you want.
Run the command dch -i
, which edits the debian/changelog file and
increments the version. Add something like "~edited1" to the end of the
version, because a version with a tilde in it is considered older than a
version without. This means Debian will let you install your edited
version over the current version, but also permit the next offical
release to supersede your hacked version.
Run the command debuild
to compile the software and build a
package.
cd ..
and then find the package that was just built. As root, run
dpkg -i
followed by this package name.
You can find more information about writing Debian or Ubuntu packages in Ubuntu's packaging guide or SIPB's packaging tutorial on the Debathena website.