14

I have qt project and deb package that is built using following command: dpkg-buildpackage -us -uc

After this action, my package is ready to install. But if I have my package installed and I want install the same or newer, it removes all files which were installed by this deb package. Only action that works is removing old package before installing newer using following command: dpkg --remove myqtapp

P.S. To install Deb package I use dpkg -i ...

3
  • Use newer branch of Debian for newer packages, e.g. testing. Nov 29, 2018 at 16:05
  • I guess you'll need to have a look at your own pre-/postinstall scripts and determine whether all the files you're distributing are actually put in sensible places ...
    – tink
    Nov 29, 2018 at 16:40
  • did you solve this problem? i'm struggling with the same problem right now, new install overrides files modified. I think with preInst and postInst we can backup all the current files and restore them after install but i think there would be a better approach
    – raultm
    Mar 12 at 10:16

1 Answer 1

20

dpkg --install package.deb should cleanly upgrade from an older version of a package to a newer one without issue. If it is complaining about a conflict, then the new package is not an upgrade but is instead an actual different package, and upgrading is (rightly) not performed. If you are not going to use apt repositories for package management, ensure you are obtaining the deb file from the same source as the older version and that it is provided as an upgrade to the prior package.

2
  • Is there any way to set this up for auto-update? Like I installed WPS office via dpkg but have to download .deb file and update it manually everytime. Thanks. Jan 22 at 7:19
  • That is beyond the scope of this question, but if you can procedurally determine a URL from which you can obtain the latest package file, you could set to a cron job to fetch the package, determine if its hash has changed from the last installed version, and if so install it.
    – DopeGhoti
    Jan 24 at 14:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.