8

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!

StephenG
  • 2,851
  • 1
  • 16
  • 36
  • What are your real goals? Just want to get the config-files out of the archive? You could try to make `/bin/sh` a symlink to `/usr/bin/true`. But be careful to not lock yourself out of your system! – Martin Höller Dec 15 '17 at 19:49
  • @MartinHöller my goal is to run `apt-get install` without running any `postinit` scripts, if included. Basically, i have a bunch of packages (built for a different architecture) that i want to install. they won't run on the system that I'm installing them on (different arch issues, etc) so I want to skip running any postinit scripts – StephenG Dec 15 '17 at 22:50

1 Answers1

7

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
Martin Höller
  • 2,714
  • 26
  • 44
  • not really an answer, doesn't acutally use `dpkg` command line options to achieve not running `postinit` scripts – StephenG Dec 21 '17 at 03:10