4

Well, I like to mark /usr/bin/program.sh as executable using following command:

chmod +x /usr/bin/program.sh

I want the above command to be executed at the end of installation of the Debian package.

Is there a painless way to inject the command into the deb?

Thanks for looking!

1 Answer 1

7

use dpkg-deb to extract the .deb file

Create a temp dir

mkdir temp

Extract the .deb file to temp directory

dpkg-deb -x file.deb temp/
cd temp/
dpkg-deb -e file.deb

Now change the DEBAIN/postinst file. This script be called right after the installation of package. So add the code which is needed for you.

Rebuild the package

dpkg-deb -b . file.deb 

or

If you don't want to edit .deb file. Create a simple shell script to call the .deb and the command you want to run.

vi test.sh
dpkg -i file.deb
/usr/bin/program.sh

and run it as ./test.sh

Hope this helps

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .