3 Answers
3

You can use the apt-get source DesktopVideo command to pull the source, diffs, and all other packaging files associated with that deb into the current directory. From there apply your patch, add a new entry in the log file dch -i, then use fakeroot and dpkg to create the package dpkg-buildpackage -rfakeroot -us -uc

It's technically possible to do what you're trying to do, but you need to be far more careful than you seem to be. It's difficult to know what you did wrong because you didn't copy-paste everything you typed. I do spot a typo (cp -R ./debian-binary debina/DEBIAN, you're obviously not reporting exactly what did ), and a mistake (cp -R doesn't preserve ownership and permissions, you would need cp -Rp or cp -a as root).

The best way to modify a package is to get the package source (apt-get source DesktopVideo). Modify the source, then add an entry to the package changelog, changing the version number so that your version is different from the official version number. Here's an example of the steps involved (Debian and Ubuntu work identically in this respect).

If you don't have the source or don't want to recompile, you could install the package, then use dpkg-divert to move the buggy file(s) out of the way and replace it by your own version. dpkg-divert tells the package manager to put a file from a given package in a different location. Here's an example of its use.

If you don't have the source of the package and you need to deploy a fix to several machines, you can install the package, then modify the buggy file, and build a new package with dpkg-repack. It's more of an act of desesperation than a robust way to manage packages; I recommend patching the source and deploying your home-compiled package if at all possible.