<p>Any specific reason that you aren't using <a href="https://wiki.debian.org/DebianRepository/SetupWithReprepro" rel="nofollow noreferrer">your own <em>real</em> package repository</a>? If you use Ansible you seem to see the benefit of automating things, so this would be a natural step. And it would enable the appropriate installation order merely based on the dependency graph and the packages available. There are other tools as well for the job, but <code>reprepo</code> is easy to use and seems ideal for smaller scale package repositories.</p>

<p>You don't give information about the system <em>on which</em> this playbook fails. But the symptoms are rather clear. And none of that has anything to do with Ansible specifically.</p>

<ul>
<li><code>/home/local_repository/wireshark_3.0.5-1_amd64.deb</code> could not be installed because it requires <em>exactly</em> <code>wireshark-qt (= 3.0.5-1)</code> (i.e. exactly that version of the <code>wireshark-qt</code> package)</li>
<li><code>/home/local_repository/wireshark-qt_3.0.5-1_amd64.deb</code> (the dependency named in the previous item) failed because its dependency <code>libc6 (&gt;= 2.29)</code> was not available.</li>
</ul>

<p>In order to figure out what exactly is going on you would have had to give information about the system. However, I can tell you how you can find out more details.</p>

<p>Simply use <code>apt-cache policy &lt;package-name&gt;</code> on both the dependencies (<code>wireshark-qt</code> and <code>libc</code>) to see which versions of the packages are at all available.</p>

<p>If I were to guess your problem is that you attempt to install this on a system which is older than the prerequisites required for the packages you attempt to install. And trying to forcibly install a newer <code>libc</code> package is a really bad idea, given its role in the system. It could leave your system unusable.</p>

<p>For example if you were attempting this on the current Debian 10 (i.e. currently <a href="https://wiki.debian.org/DebianBuster" rel="nofollow noreferrer">Buster</a>==stable), you can see in <a href="https://tracker.debian.org/pkg/glibc" rel="nofollow noreferrer">this table</a> (contents are bound to change, so I am including the screenshot) that alone the <code>libc6 (&gt;= 2.29)</code> prerequisite cannot be satisfied:</p>

<p><a href="https://i.sstatic.net/8VSJY.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/8VSJY.png" alt="Overview of libc versions on the various Debian releases"></a></p>

<p>Alternatively you can look <a href="https://packages.debian.org/en/source/sid/glibc" rel="nofollow noreferrer">here</a> and navigate between the current releases in the top right (at the time of this writing):</p>

<p><a href="https://i.sstatic.net/jwjng.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/jwjng.png" alt="Navigate between Debian release to see available package versions"></a></p>

<p>The first step to figure out whether there is a newer package available would be to look at the <a href="https://packages.debian.org/search?keywords=wireshark&amp;suite=buster-backports" rel="nofollow noreferrer">package search</a> for your current release. To find out what that is, use <code>lsb_release -a</code> (to see all information) or <code>lsb_release -cs</code> to see the short codename (e.g. <code>buster</code>).</p>

<p><a href="https://packages.ubuntu.com/search?suite=default&amp;section=all&amp;arch=any&amp;keywords=wireshark&amp;searchon=names" rel="nofollow noreferrer">Here is a similar overview for Ubuntu</a>:</p>

<p><a href="https://i.sstatic.net/fwTEH.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/fwTEH.png" alt="Ubuntu package search for wireshark"></a></p>

<p>Looking at the package versions you attempt to install, I'd guess you are attempting to install the <code>eoan</code> (19.10) package on an older Ubuntu, am I right?</p>

<p>You <em>could</em> attempt to download the sources (<code>apt-get source &lt;package-name&gt;</code>) of the two packages in question (<code>wireshark</code> and <code>wireshark-qt</code>) and attempt to <a href="https://wiki.debian.org/BuildingTutorial" rel="nofollow noreferrer">build it yourself</a>. If you're lucky you can build that new Wireshark version against whatever Qt and libc versions are included in your specific release. Arguably Qt (and <em>its</em> dependencies) would be more likely to be an issue than libc.</p>

<p>Alas, chances are that it will be easier to upgrade your system to 19.10, wait ~4 months until <code>focal</code> aka Focal Fossa (Ubuntu 20.04) gets released or install a VM or container enabling you to run that newer Wireshark version.</p>

<p>But again, none of that has anything to do with Ansible, except that you used Ansible to invoke the installation commands.</p>

CC BY-SA 4.0
2019-12-13T12:00:42.650Z
2019-12-13T19:08:16.637Z
2019-12-13T19:08:16.637Z
0xC0000022L
<p>I have simple playbook where trying to install the Debian packages downloaded locally in my server. This playbook runs on localhost and install the Debian packages in the same system. 
But this playbook gives an error <strong>"Dependency is not satisfiable</strong> for some of the packages even tough the dependency package is available in the local repository.</p>

<p>I can download all the dependencies required for the specific package in my local repository using  <strong>apt-get install --download-only package_name</strong> </p>

<p>But in my playbook, i should have a mechanism to install the dependencies first than install the actual package. This task should be dynamic, playbook should resolve the dependencies by itself for any package install.</p>

<p><strong><em>When the package has dependency over another package, How the playbook resolve dynamically.</em></strong></p>

<p>Some of the options explored:</p>

<p>Using ordered indexed_items, using gdebi.. Looking for efficient Logic.</p>

<p><strong>install_dependencies.yml</strong></p>

<pre><code>---
- hosts: localhost
  vars:
    remote_media_directory: "/home/local_repository"
  become: yes
  tasks:
    - name: find all debian Packages
      find:
         paths:
             - "{{ remote_media_directory }}"
         file_type: file
         recurse: yes
         use_regex: yes
         patterns:
           - '.*deb$'
      register: files_matched_subdirectory

    - name: installation debian packages
      apt:
        deb: "{{ item.path }}"
      with_items: "{{ files_matched_subdirectory.files }}"
      when: ansible_distribution == "Ubuntu"
</code></pre>

<blockquote>
  <p>ansible-playbook install_dependencies.yml</p>
</blockquote>

<pre><code>PLAY [localhost] **********************************************************************************************************************************************************************************************

TASK [Gathering Facts] ****************************************************************************************************************************************************************************************
ok: [localhost]

TASK [find all debian Packages] *******************************************************************************************************************************************************************************
ok: [localhost]

TASK [installation debian packages] ***************************************************************************************************************************************************************************
failed: [localhost] (item={u'uid': 0, u'woth': False, u'mtime': 1571850269.5720358, u'inode': 31195175, u'isgid': False, u'size': 46700, u'roth': True, u'isuid': False, u'isreg': True, u'pw_name': u'root', u'gid': 0, u'ischr': False, u'wusr': True, u'xoth': False, u'rusr': True, u'nlink': 1, u'issock': False, u'rgrp': True, u'gr_name': u'root', u'path': u'/home/local_repository/wireshark_3.0.5-1_amd64.deb', u'xusr': False, u'atime': 1571850391.3553286, u'isdir': False, u'ctime': 1571850312.2437878, u'wgrp': False, u'xgrp': False, u'dev': 2051, u'isblk': False, u'isfifo': False, u'mode': u'0644', u'islnk': False}) =&gt; {"changed": false, "item": {"atime": 1571850391.3553286, "ctime": 1571850312.2437878, "dev": 2051, "gid": 0, "gr_name": "root", "inode": 31195175, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mode": "0644", "mtime": 1571850269.5720358, "nlink": 1, "path": "/home/local_repository/wireshark_3.0.5-1_amd64.deb", "pw_name": "root", "rgrp": true, "roth": true, "rusr": true, "size": 46700, "uid": 0, "wgrp": false, "woth": false, "wusr": true, "xgrp": false, "xoth": false, "xusr": false}, "msg": "Dependency is not satisfiable: wireshark-qt (= 3.0.5-1)\n"}
failed: [localhost] (item={u'uid': 0, u'woth': False, u'mtime': 1571850269.4560366, u'inode': 31195174, u'isgid': False, u'size': 3605060, u'roth': True, u'isuid': False, u'isreg': True, u'pw_name': u'root', u'gid': 0, u'ischr': False, u'wusr': True, u'xoth': False, u'rusr': True, u'nlink': 1, u'issock': False, u'rgrp': True, u'gr_name': u'root', u'path': u'/home/local_repository/wireshark-qt_3.0.5-1_amd64.deb', u'xusr': False, u'atime': 1571850394.3993108, u'isdir': False, u'ctime': 1571850312.2437878, u'wgrp': False, u'xgrp': False, u'dev': 2051, u'isblk': False, u'isfifo': False, u'mode': u'0644', u'islnk': False}) =&gt; {"changed": false, "item": {"atime": 1571850394.3993108, "ctime": 1571850312.2437878, "dev": 2051, "gid": 0, "gr_name": "root", "inode": 31195174, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mode": "0644", "mtime": 1571850269.4560366, "nlink": 1, "path": "/home/local_repository/wireshark-qt_3.0.5-1_amd64.deb", "pw_name": "root", "rgrp": true, "roth": true, "rusr": true, "size": 3605060, "uid": 0, "wgrp": false, "woth": false, "wusr": true, "xgrp": false, "xoth": false, "xusr": false}, "msg": "Dependency is not satisfiable: libc6 (&gt;= 2.29)\n"}
ok: [localhost] =&gt; (item={u'uid': 0, u'woth': False, u'mtime': 1571850217.1323407, u'inode': 31195169, u'isgid': False, u'size': 40654, u'roth': True, u'isuid': False, u'isreg': True, u'pw_name': u'root', u'gid': 0, u'ischr': False, u'wusr': True, u'xoth': False, u'rusr': True, u'nlink': 1, u'issock': False, u'rgrp': True, u'gr_name': u'root', u'path': u'/home/local_repository/tree_1.7.0-5_amd64.deb', u'xusr': False, u'atime': 1571850397.4392931, u'isdir': False, u'ctime': 1571850312.2437878, u'wgrp': False, u'xgrp': False, u'dev': 2051, u'isblk': False, u'isfifo': False, u'mode': u'0644', u'islnk': False})
ok: [localhost] =&gt; (item={u'uid': 0, u'woth': False, u'mtime': 1571850217.0163412, u'inode': 31195168, u'isgid': False, u'size': 52132, u'roth': True, u'isuid': False, u'isreg': True, u'pw_name': u'root', u'gid': 0, u'ischr': False, u'wusr': True, u'xoth': False, u'rusr': True, u'nlink': 1, u'issock': False, u'rgrp': True, u'gr_name': u'root', u'path': u'/home/local_repository/dstat_0.7.3-1_all.deb', u'xusr': False, u'atime': 1571850399.3192823, u'isdir': False, u'ctime': 1571850312.2437878, u'wgrp': False, u'xgrp': False, u'dev': 2051, u'isblk': False, u'isfifo': False, u'mode': u'0644', u'islnk': False})
        to retry, use: --limit @/home/upgrade/ansible/install_dependencies.retry

PLAY RECAP ****************************************************************************************************************************************************************************************************
localhost                  : ok=2    changed=0    unreachable=0    failed=1
</code></pre>

CC BY-SA 4.0
2019-10-24T07:44:22.923Z
does `install_recommends: true` on the apt task have any effect?
Bruce Becker
CC BY-SA 4.0
2019-10-24T14:39:07.637Z
I don't have any idea about this..
john 517501
CC BY-SA 4.0
2019-11-22T14:13:11.923Z
Have you tried installing with `dkpg -i` then do a `apt-get install -f`? The module  APT with option `dpkg_options` might be needed. I think this is a Debian related issue, more than an Ansible one.
Nico
<linux>
How to resolve the dependencies while installing locally downloaded packages?
john 517501
# How to resolve the dependencies while installing locally downloaded packages?

(Asked by: username_0 on 2019-10-23)

I have simple playbook where trying to install the Debian packages downloaded locally in my server. This playbook runs on localhost and install the Debian packages in the same system. 
But this playbook gives an error "Dependency is not satisfiable for some of the packages even tough the dependency package is available in the local repository.
I can download all the dependencies required for the specific package in my local repository using  apt-get install --download-only package_name 
But in my playbook, i should have a mechanism to install the dependencies first than install the actual package. This task should be dynamic, playbook should resolve the dependencies by itself for any package install.
When the package has dependency over another package, How the playbook resolve dynamically.
Some of the options explored:
Using ordered indexed_items, using gdebi.. Looking for efficient Logic.
install_dependencies.yml
---
- hosts: localhost
  vars:
    remote_media_directory: "/home/local_repository"
  become: yes
  tasks:
    - name: find all debian Packages
      find:
         paths:
             - "{{ remote_media_directory }}"
         file_type: file
         recurse: yes
         use_regex: yes
         patterns:
           - '.*deb$'
      register: files_matched_subdirectory

    - name: installation debian packages
      apt:
        deb: "{{ item.path }}"
      with_items: "{{ files_matched_subdirectory.files }}"
      when: ansible_distribution == "Ubuntu"


ansible-playbook install_dependencies.yml

PLAY [localhost] **********************************************************************************************************************************************************************************************

TASK [Gathering Facts] ****************************************************************************************************************************************************************************************
ok: [localhost]

TASK [find all debian Packages] *******************************************************************************************************************************************************************************
ok: [localhost]

TASK [installation debian packages] ***************************************************************************************************************************************************************************
failed: [localhost] (item={u'uid': 0, u'woth': False, u'mtime': 1571850269.5720358, u'inode': 31195175, u'isgid': False, u'size': 46700, u'roth': True, u'isuid': False, u'isreg': True, u'pw_name': u'root', u'gid': 0, u'ischr': False, u'wusr': True, u'xoth': False, u'rusr': True, u'nlink': 1, u'issock': False, u'rgrp': True, u'gr_name': u'root', u'path': u'/home/local_repository/wireshark_3.0.5-1_amd64.deb', u'xusr': False, u'atime': 1571850391.3553286, u'isdir': False, u'ctime': 1571850312.2437878, u'wgrp': False, u'xgrp': False, u'dev': 2051, u'isblk': False, u'isfifo': False, u'mode': u'0644', u'islnk': False}) => {"changed": false, "item": {"atime": 1571850391.3553286, "ctime": 1571850312.2437878, "dev": 2051, "gid": 0, "gr_name": "root", "inode": 31195175, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mode": "0644", "mtime": 1571850269.5720358, "nlink": 1, "path": "/home/local_repository/wireshark_3.0.5-1_amd64.deb", "pw_name": "root", "rgrp": true, "roth": true, "rusr": true, "size": 46700, "uid": 0, "wgrp": false, "woth": false, "wusr": true, "xgrp": false, "xoth": false, "xusr": false}, "msg": "Dependency is not satisfiable: wireshark-qt (= 3.0.5-1)\n"}
failed: [localhost] (item={u'uid': 0, u'woth': False, u'mtime': 1571850269.4560366, u'inode': 31195174, u'isgid': False, u'size': 3605060, u'roth': True, u'isuid': False, u'isreg': True, u'pw_name': u'root', u'gid': 0, u'ischr': False, u'wusr': True, u'xoth': False, u'rusr': True, u'nlink': 1, u'issock': False, u'rgrp': True, u'gr_name': u'root', u'path': u'/home/local_repository/wireshark-qt_3.0.5-1_amd64.deb', u'xusr': False, u'atime': 1571850394.3993108, u'isdir': False, u'ctime': 1571850312.2437878, u'wgrp': False, u'xgrp': False, u'dev': 2051, u'isblk': False, u'isfifo': False, u'mode': u'0644', u'islnk': False}) => {"changed": false, "item": {"atime": 1571850394.3993108, "ctime": 1571850312.2437878, "dev": 2051, "gid": 0, "gr_name": "root", "inode": 31195174, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mode": "0644", "mtime": 1571850269.4560366, "nlink": 1, "path": "/home/local_repository/wireshark-qt_3.0.5-1_amd64.deb", "pw_name": "root", "rgrp": true, "roth": true, "rusr": true, "size": 3605060, "uid": 0, "wgrp": false, "woth": false, "wusr": true, "xgrp": false, "xoth": false, "xusr": false}, "msg": "Dependency is not satisfiable: libc6 (>= 2.29)\n"}
ok: [localhost] => (item={u'uid': 0, u'woth': False, u'mtime': 1571850217.1323407, u'inode': 31195169, u'isgid': False, u'size': 40654, u'roth': True, u'isuid': False, u'isreg': True, u'pw_name': u'root', u'gid': 0, u'ischr': False, u'wusr': True, u'xoth': False, u'rusr': True, u'nlink': 1, u'issock': False, u'rgrp': True, u'gr_name': u'root', u'path': u'/home/local_repository/tree_1.7.0-5_amd64.deb', u'xusr': False, u'atime': 1571850397.4392931, u'isdir': False, u'ctime': 1571850312.2437878, u'wgrp': False, u'xgrp': False, u'dev': 2051, u'isblk': False, u'isfifo': False, u'mode': u'0644', u'islnk': False})
ok: [localhost] => (item={u'uid': 0, u'woth': False, u'mtime': 1571850217.0163412, u'inode': 31195168, u'isgid': False, u'size': 52132, u'roth': True, u'isuid': False, u'isreg': True, u'pw_name': u'root', u'gid': 0, u'ischr': False, u'wusr': True, u'xoth': False, u'rusr': True, u'nlink': 1, u'issock': False, u'rgrp': True, u'gr_name': u'root', u'path': u'/home/local_repository/dstat_0.7.3-1_all.deb', u'xusr': False, u'atime': 1571850399.3192823, u'isdir': False, u'ctime': 1571850312.2437878, u'wgrp': False, u'xgrp': False, u'dev': 2051, u'isblk': False, u'isfifo': False, u'mode': u'0644', u'islnk': False})
        to retry, use: --limit @/home/upgrade/ansible/install_dependencies.retry

PLAY RECAP ****************************************************************************************************************************************************************************************************
localhost                  : ok=2    changed=0    unreachable=0    failed=1

**Tags:** linux

> **Comments:**
> **username_1**: does `install_recommends: true` on the apt task have any effect?  
> **username_0**: I don't have any idea about this..  
> **username_2**: Have you tried installing with `dkpg -i` then do a `apt-get install -f`? The module  APT with option `dpkg_options` might be needed. I think this is a Debian related issue, more than an Ansible one.  

---

## 1 answers

### Answer by username_3 on 2019-12-13. Score: 2 | Accepted answer

Any specific reason that you aren't using [your own *real* package repository](https://wiki.debian.org/DebianRepository/SetupWithReprepro)? If you use Ansible you seem to see the benefit of automating things, so this would be a natural step. And it would enable the appropriate installation order merely based on the dependency graph and the packages available. There are other tools as well for the job, but `reprepo` is easy to use and seems ideal for smaller scale package repositories.

You don't give information about the system *on which* this playbook fails. But the symptoms are rather clear. And none of that has anything to do with Ansible specifically.

* `/home/local_repository/wireshark_3.0.5-1_amd64.deb` could not be installed because it requires *exactly* `wireshark-qt (= 3.0.5-1)` (i.e. exactly that version of the `wireshark-qt` package)
* `/home/local_repository/wireshark-qt_3.0.5-1_amd64.deb` (the dependency named in the previous item) failed because its dependency `libc6 (>= 2.29)` was not available.

In order to figure out what exactly is going on you would have had to give information about the system. However, I can tell you how you can find out more details.

Simply use `apt-cache policy`  on both the dependencies (`wireshark-qt` and `libc`) to see which versions of the packages are at all available.

If I were to guess your problem is that you attempt to install this on a system which is older than the prerequisites required for the packages you attempt to install. And trying to forcibly install a newer `libc` package is a really bad idea, given its role in the system. It could leave your system unusable.

For example if you were attempting this on the current Debian 10 (i.e. currently [Buster](https://wiki.debian.org/DebianBuster)==stable), you can see in [this table](https://tracker.debian.org/pkg/glibc) (contents are bound to change, so I am including the screenshot) that alone the `libc6 (>= 2.29)` prerequisite cannot be satisfied:

[![Overview of libc versions on the various Debian releases](https://i.sstatic.net/8VSJY.png)](https://i.sstatic.net/8VSJY.png)

Alternatively you can look [here](https://packages.debian.org/en/source/sid/glibc) and navigate between the current releases in the top right (at the time of this writing):

[![Navigate between Debian release to see available package versions](https://i.sstatic.net/jwjng.png)](https://i.sstatic.net/jwjng.png)

The first step to figure out whether there is a newer package available would be to look at the [package search](https://packages.debian.org/search?keywords=wireshark&suite=buster-backports) for your current release. To find out what that is, use `lsb_release -a` (to see all information) or `lsb_release -cs` to see the short codename (e.g. `buster`).

[Here is a similar overview for Ubuntu](https://packages.ubuntu.com/search?suite=default§ion=all&arch=any&keywords=wireshark&searchon=names):

[![Ubuntu package search for wireshark](https://i.sstatic.net/fwTEH.png)](https://i.sstatic.net/fwTEH.png)

Looking at the package versions you attempt to install, I'd guess you are attempting to install the `eoan` (19.10) package on an older Ubuntu, am I right?

You *could* attempt to download the sources (`apt-get source` ) of the two packages in question (`wireshark` and `wireshark-qt`) and attempt to [build it yourself](https://wiki.debian.org/BuildingTutorial). If you're lucky you can build that new Wireshark version against whatever Qt and libc versions are included in your specific release. Arguably Qt (and *its* dependencies) would be more likely to be an issue than libc.

Alas, chances are that it will be easier to upgrade your system to 19.10, wait ~4 months until `focal` aka Focal Fossa (Ubuntu 20.04) gets released or install a VM or container enabling you to run that newer Wireshark version.

But again, none of that has anything to do with Ansible, except that you used Ansible to invoke the installation commands.


---

