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!

2
  • 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! Commented Dec 15, 2017 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 Commented Dec 15, 2017 at 22:50

1 Answer 1

7
+25

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 
Sign up to request clarification or add additional context in comments.

1 Comment

not really an answer, doesn't acutally use dpkg command line options to achieve not running postinit scripts

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.