ubuntuconfigurationdebiandpkgdebconf

Purging Debian dpkg-deb config information complately


I am creating a debian package (.deb)
I wanted to get answer to some questions.
Somehow, installation of newly created .deb file was not asking question after asking once, even if package is purged
Setting question priority critical does not help
How can remove old answers totally? This is important during package creation page


Solution

  • Another way to remove all of your package's questions from debconf's database is to call db_purge in your postrm script, when removing or purging the package.

    You have to previously load the debconf library:

    . /usr/share/debconf/confmodule

    For example:

    #! /bin/sh
    
    set -e
    
    # Source debconf library.
    . /usr/share/debconf/confmodule
    
    case "$1" in
        remove|purge)
    
            # Remove all package's questions from debconf's database.
            db_purge
        ;;
    
        *)
            exit 0
        ;;
    esac
    
    exit 0