There are deb instances where you need to modify some file(s) inside and repack it.
This can be done very easily on Ubuntu and Debian using dkpg-deb
-
Copy the
deb
file into a directory -
Create the directory structure
$ mkdir -p newpack oldpack/DEBIAN
-
Extract the filesystem tree
$ dpkg-deb -x file.deb oldpack/
-
Extract the control information files
$ dpkg-deb -e file.deb oldpack/DEBIAN
-
Modify what that you need
-
Repackage the deb file under newpack directory using
xz
compression$ dpkg-deb -Z xz -b oldpack/ newpack/