Ubuntu / Debian: You can repack any installed package on your system into a .deb file. Here is how.

You will need dpkg-repack so the first thing you need to do is install this:

apt-get install dpkg-repack

Then simply run


For instance, to repack Rhythmbox, you would run this:

dpkg-repack rhythmbox

This will generate a .deb file of Rhythmbox in the directory where you run the command.

dpck-repack will only run as root! If you don’t want to run it as root, install fakeroot:

sudo apt-get install fakeroot

And use it like so:

fakeroot -u dpkg-repack

One interesting thing about using dpkg-repack is that it will install any configuration files from /etc as they are upon the current host – rather than their pristine version(s). This is either a very useful thing, or not what you would expect.

For more details of using the package please see the man-page, accessible by running “man dpkg-repack”.