Upgrading a list of packages from local .deb files

Hello, I have the issue with upgrading our product on Debian-based systems.

We have already installed packages of the version, for example, 2.0. There are several packages and some of it depend of the other.

When I’m trying to upgrade the product from the version 2.0 to the version 2.1, passing a list of .deb packages, the error occurs because of an unresolved dependency.

Below there is a yml-fragment to illustrate what I do:

  • name: Installing packages [apt]
    apt:
    deb=“{{ packages_to_install }}”
    state=present
    update_cache=yes
    when: ansible_pkg_mgr == “apt”

I tried to find out what’s going on under the hood by debugging the Ansible’s apt module:

  • when iterating over the list of .deb files, for each file there is a check of the package’s version with version of the already installed package with the same name
  • if versions are differ, there is a call to the apt.debfile.DebPackage.check() function, which in my case returns false (this is due to the fact that in case of installing a newer version of a package there will be a dependency conflict for another package, which is also part of our product).

In case of yum, this case passes successfully - the Ansible’s yum module supports thansactional update from local .rpm files.

What will be the right solution for Debian?
Perform full deinstallation of the product before installing the new version? Or should I patch the Ansible’s apt module?