re-trigger the post installation script of a package

Asked by Tong Sun on 2013-11-04


I installed a package (docker,, but something went wrong (dependent package missing) during post installation, so I have to remove the package and re-install it again.

How to re-trigger the post installation script of a package, so that having fixed the (dependent) problem, I don't need to remove and re-install the package again?


Question information

English Edit question
Ubuntu dpkg Edit question
No assignee Edit question
Solved by:
Manfred Hampl
Last query:
Last reply:

What is the output of:

uname -a; lsb_release -a


Tong Sun (suntong001) said : #2

This is a generic question that isn't tied to any particular releases.

But since you asked, here they are:

$ uname -a; lsb_release -a
Linux vub13R2 3.11.0-13-generic #20-Ubuntu SMP Wed Oct 23 07:38:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 13.10
Release: 13.10
Codename: saucy

Why not just run:

sudo apt-get install docker

It's in the official repos......

Tong Sun (suntong001) said : #4

Thanks but I provide more detailed info about the package only to make it easy to understand. Please don't get side tracked about that particular package.

Again, this is a generic question that isn't tied to any particular releases, or any particular package. The question is about "
re-trigger the post installation script of a package".

If you don't know the answer or what I'm talking about, feel free to ignore it for others to answer.


Best Manfred Hampl (m-hampl) said : #5

I think
dpkg --configure packagename
dpkg-reconfigure packagename
will do what you want.

excerpt of dpkg manpages:
       --configure package...|-a|--pending
              Configure a package which has been unpacked but not yet
              configured. If -a or --pending is given instead of package, all
              unpacked but unconfigured packages are configured.

              To reconfigure a package which has already been configured, try
              the dpkg-reconfigure(8) command instead.

              Configuring consists of the following steps:

              1. Unpack the conffiles, and at the same time back up the old
              conffiles, so that they can be restored if something goes wrong.

              2. Run postinst script, if provided by the package.

Tong Sun (suntong001) said : #6

Thanks Manfred.