How to get current running version of a package in dpkg postinst and preinst script

by user3038057   Last Updated November 20, 2017 09:02 AM

I am creating a debian package that discard some database operations carried out in postinst script of the package if its previous version is installed. I googled and I find it for RPM but I could not find for debian.

I am wondering if there is an equivalent variable or something of %pre[un] or %post[un] for debian ?


Related Questions

Is it safe to install debian packages on ubuntu?

Updated March 14, 2017 22:02 PM

apt-get broken: No module named debian.deb822

Updated April 07, 2015 18:00 PM

Getting + installing gcc/g++ 4.9 on Ubuntu?

Updated April 13, 2015 20:00 PM