How can I upgrade my deb package

21,253

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.

Share:
21,253
Vlad
Author by

Vlad

Updated on September 18, 2022

Comments

  • Vlad
    Vlad over 1 year

    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 ...

    • Ipor Sircer
      Ipor Sircer over 5 years
      Use newer branch of Debian for newer packages, e.g. testing.
    • tink
      tink over 5 years
      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 ...
    • raultm
      raultm about 2 years
      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
  • theProcrastinator
    theProcrastinator over 2 years
    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.
  • Pankaj Goyal
    Pankaj Goyal over 2 years
    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.