StephenG
StephenG

Reputation: 2881

How to use command line dpkg options to unpack conf and skip postinst script

I have a need to run dpkg install, unpack the conf files, but skip running the postinst scripts (if it's included in the deb file).

I've tried to change the SHELL variable to /usr/bin/true, but that didn't work. Any other ideas would be great!

Upvotes: 8

Views: 2488

Answers (1)

Martin Höller
Martin Höller

Reputation: 2869

According to its man-page dpkg doesn't have a command-line-option to disable script execution. However, you can achieve what you want with the following commands (taken from this answer from an ubuntu forum):

apt-get download <package>
sudo dpkg --unpack <package>*.deb
sudo rm /var/lib/dpkg/info/<package>.postinst -f
sudo dpkg --configure <package>
sudo apt-get install -yf #To fix dependencies

Upvotes: 7

Related Questions