I compiled and packaged QEMU for my Raspberry Pi, but apt thinks that by installing it I'm "downgrading" from 1.3.1 (latest available in the repos) to 5.2.50 (my deb). so now every time I run
apt upgrade apt "upgrades" from 5.2.50 (my deb) to 1.3.1 (latest available in the repos).
for now I'm using
sudo apt-mark hold qemu.
what I want is to make the
postinst script in the deb to hold the package from updating and the
prerm script to uphold it, I know you can't run apt and dpkg commands from those scripts without removing dpkg locks or something like that that I don't want to do.
my question: is there a way to hold the package from updating with the
postinst script and untold it with the
prerm script without removing the dpkg locks?