Edit Debian Package and Recreate it

By | March 5, 2012

So, recently I was forced to change a debian package to install it during the installation of the DVD. So, basically all I need to do is to change the Priority level of the package in the “control file” from optional or standard to important and then edit the iso dvd.

NOTE: Check this to find how to you can edit an iso dvd.

1: Make directory, /home/edit-deb

2: Copy debian file to the directory. Lets say we have a debian file, sample.deb and we copy it to /home/edit-deb

3: Now, create one more directory (/home/edit-deb/sample)

4: Just go to /home/edit-deb

cd /home/edit-deb

5: Extract debian package data using the following command.

dpkg-deb –extract sample.deb ./sample

6: Extract debian installer files (control, preinst, postinst, prerm, postrm etc)

dpkg-deb -e openssh-client_5.1p1-5_amd64.deb ./sample/DEBIAN

7: Now, you have extracted all the files in sample.deb. Make changes to files in /home/edit-deb/sample and /home/edit-deb/sample/DEBIAN.

8: Recreate the new debian backage after making changes by using the following commands.

cd /home/edit-deb
mv sample.deb sample_backup.deb
dpkg-deb -b sample

9: Once you run all the above commands, now you should see the new sample.deb which is the newer version of the package.

My Source

If you like this article, then please consider sharing it. Sharing really inspires us to do things much better!!

Leave a Reply

Your email address will not be published. Required fields are marked *