I am answering this question myself because others may find this information useful. This Q&A was inspired about another one: How do I install Citrix ICA Client (Receiver) 13 on Debian 64-bit Linux?
- Create a temp directory and copy the
.deb
file to it. - Extract the
.deb
file:ar vx archive.deb
- Three files will appear:
debian-binary
: Do not touchcontrol.tar.gz
: Config and scripts to install and uninstall- This file may have a different extension, depending on the compression format used.
data.tar.gz
: Files to be installed- This file may have a different extension, depending on the compression format used.
Both *.tar.gz
files may different extensions, depending on the compression format used. The .deb
format supports a few different ones. Also both *.tar.gz
files are tarbombs, so all the files will explode to the same path. Better to create a temp directory, copy, then extract.
File control.tar.gz
has two files good for hacking:
control
: Contains package dependency list. You can add/remove dependencies.postinst
: Contains the post-installation script. You can add/remove commands.
Recreate the *.tar.gz
files as: tar -czvf control.tar.gz *
or (data.tar.gz
)
Finally, create a new archive. Order is very important here: ar rv my_new_package.deb debian-binary control.tar.gz data.tar.gz
You can try your new package with these commands:
- Uninstall existing package:
apt-get remove $package_name
- ... where
$package_name
is the name of your package, e.g.,icaclient
- ... where
- Install new package:
dpkg --install my_new_package.deb
Ref: http://tldp.org/HOWTO/html_single/Debian-Binary-Package-Building-HOWTO/