Date: 26 Oct, 2012
Posted by: admin
In: hints & tips|linux, open source & software
Decompressed a .deb package and thought that recompressing would be as simple, but it’s not. Here’s what to do.
The package I was looking at was google-talkplugin_current_amd64.deb to enable video casting via YouTube. Looking at the package contents I noticed a cron job I didn’t really want to run every day (auto updates presumably without asking at install) and some language files that apt-get normally removes for me (via localepurge). So I thought I’d modify the package.
I simply unzipped, the package, unzipped the data.tar.gz, removed the files from the tree that I didn’t want, compressed the file tree back as data.tar.gz and then swapped the data.tar.gz via ark [archive manager for KDE] for the old one. Unfortunately that doesn’t then install:
$ dpkg-deb -I google-talkplugin_current_amd64.deb
dpkg-deb: error: `google-talkplugin_current_amd64.deb' is not a debian format archive
So, what you should do is make a directory structure like so:
google-talkplugin_current_amd64
|– DEBIAN
| |– control
| |– debian-binary
| |– md5sums
| |– postinst
| `– postrm
|– opt
| `– google
| `– talkplugin
| |– attributions.txt
| |– data
| | |– LMprec_508.emd
| | |– MFTprec_120.emd
| | `– SFTprec_120.emd
| |– GoogleTalkPlugin
| |– lib
| | |– libCgGL.so
| | `– libCg.so
| |– libgoogletalkremoting.so
| |– libnpgoogletalk.so
| |– libnpgtpo3dautoplugin.so
| |– locale
| | |– en
| | | `– LC_MESSAGES
| | | `– windowpicker.mo
| | `– en-GB
| | `– LC_MESSAGES
| | `– windowpicker.mo
| `– windowpicker.glade
`– usr
|– lib
| |– firefox
| | `– plugins
| | |– libnpgoogletalk.so -> /opt/google/talkplugin/libnpgoogletalk.so
| | `– libnpgtpo3dautoplugin.so -> /opt/google/talkplugin/libnpgtpo3dautoplugin.so
| |– mozilla
| | `– plugins
| | |– libnpgoogletalk.so -> /opt/google/talkplugin/libnpgoogletalk.so
| | `– libnpgtpo3dautoplugin.so -> /opt/google/talkplugin/libnpgtpo3dautoplugin.so
| |– xulrunner
| | `– plugins
| | |– libnpgoogletalk.so -> /opt/google/talkplugin/libnpgoogletalk.so
| | `– libnpgtpo3dautoplugin.so -> /opt/google/talkplugin/libnpgtpo3dautoplugin.so
| `– xulrunner-addons
| `– plugins
| |– libnpgoogletalk.so -> /opt/google/talkplugin/libnpgoogletalk.so
| `– libnpgtpo3dautoplugin.so -> /opt/google/talkplugin/libnpgtpo3dautoplugin.so
`– share
`– doc
`– google-talkplugin
`– changelog.Debian.gz
Use the command:
$ dpkg-deb -b google-talkplugin_current_amd64 google-talkplugin_current_amd64.deb
Which is dpkg-deb -b [or –build] followed by the directory holding the package files and the name for the package. If you did it right should give a response like
dpkg-deb: building package `google-talkplugin’ in `google-talkplugin_current_amd64.deb’.
Then you just install as normal (I use gdebi-gtk by just clicking on the package in my file manager [dolphin]). Happy packing.
[…] I followed my own post on rebuilding deb packages in order to fix it. Simply decompressed the package, remove “bluez-alsa” from the […]