I am creating my own deb package that should replace the old packages. In his Control file, I write:
Provides: package1, package2
Conflicts: package1 package2
Replacements: package1, package2
Next, after I created it, I start installing it, in the output I see the following sequence
- Package1 is being deleted
- Package2 is being deleted
- the preinst script is launched
My problem is that I need to save the files that are deleted when package1 and package2 are deleted. Accordingly, I need the following to happen:
- calling some script that I carry in the deb package when trying to delete package1
- Package1 is being deleted
- calling some script that I carry in the deb package when trying to delete package1
- Package2 is being deleted
- the preinst script is launched
Is it possible to do this exclusively in the deb package that I am creating? That is, I want to run apt install ./mypackage.deb and what I want happened?
I have tried different configurations. I also tried to figure out if the dpkg triggers logic could help me, but I still couldn't figure out how these dpkg triggers work. And apparently this is not what is needed.