Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 543
StephenG Avatar asked Dec 11 '17 22:12

StephenG


1 Answers

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
like image 110
Martin Höller Avatar answered Sep 23 '22 00:09

Martin Höller