snippetMinor
How to resolve the dependencies while installing locally downloaded packages?
Viewed 0 times
downloadedthewhilelocallyresolveinstallinghowpackagesdependencies
Problem
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
ansible-playbook install_dependencies.yml
```
PLAY [localhost]
TASK [Gathering Facts] ****
ok: [localhost]
TASK [find
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
ansible-playbook install_dependencies.yml
```
PLAY [localhost]
TASK [Gathering Facts] ****
ok: [localhost]
TASK [find
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
Solution
Any specific reason that you aren't using your own real package repository? 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
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.
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
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
For example if you were attempting this on the current Debian 10 (i.e. currently Buster==stable), you can see in this table (contents are bound to change, so I am including the screenshot) that alone the
Alternatively you can look here and navigate between the current releases in the top right (at the time of this writing):
The first step to figure out whether there is a newer package available would be to look at the package search for your current release. To find out what that is, use
Here is a similar overview for Ubuntu:
Looking at the package versions you attempt to install, I'd guess you are attempting to install the
You could attempt to download the sources (
Alas, chances are that it will be easier to upgrade your system to 19.10, wait ~4 months until
But again, none of that has anything to do with Ansible, except that you used Ansible to invoke the installation commands.
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.debcould not be installed because it requires exactlywireshark-qt (= 3.0.5-1)(i.e. exactly that version of thewireshark-qtpackage)
/home/local_repository/wireshark-qt_3.0.5-1_amd64.deb(the dependency named in the previous item) failed because its dependencylibc6 (>= 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==stable), you can see in this table (contents are bound to change, so I am including the screenshot) that alone the
libc6 (>= 2.29) prerequisite cannot be satisfied:Alternatively you can look here and navigate between the current releases in the top right (at the time of this writing):
The first step to figure out whether there is a newer package available would be to look at the package search 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:
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. 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.
Context
StackExchange DevOps Q#9546, answer score: 2
Revisions (0)
No revisions yet.