How do I resolve “The following packages have unmet dependen

Post your Debian questions here.

How do I resolve “The following packages have unmet dependen

Postby JAMES_KEITH » July 31st, 2019, 5:50 pm

I am setting up a new Server (Debian 10). I need to install required packages (and some Perl Modules) with_items using default package manager (apt). When I run my playbook, I receive the following failure:

Code: Select all
force-confdef\" -o \"Dpkg::Options::=--force-confold\"     --simulate install 'libexpat1-dev'' failed: E: Unable to correct problems, you have held broken packages.\n", "rc": 100, "stderr": "E: Unable to correct problems, you have held

broken packages.\n", "stderr_lines": ["E: Unable to correct problems, you have held broken packages."], "stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\nSome packages could not be

installed. This may mean that you have\nrequested an impossible situation or if you are using the unstable\ndistribution that some required packages have not yet been created\nor been moved out of Incoming.\nThe following information

may help to resolve the situation:\n\nThe following packages have unmet dependencies:\n libexpat1-dev : Depends: libexpat1 (= 2.1.0-1+deb7u2) but 2.1.0-1+deb7u4 is to be installed\n", "stdout_lines": ["Reading package lists...",

"Building dependency tree...", "Reading state information...", "Some packages could not be installed. This may mean that you have", "requested an impossible situation or if you are using the unstable", "distribution that some required

packages have not yet been created", "or been moved out of Incoming.", "The following information may help to resolve the situation:", "", "The following packages have unmet dependencies:", " libexpat1-dev : Depends: libexpat1 (=

2.1.0-1+deb7u2) but 2.1.0-1+deb7u4 is to be installed"]}


Ansible Version:

Code: Select all
ansible 2.8.0
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/home/kjames/.ansible/plugins/modules',
u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.5 (default, Apr  9 2019, 14:30:50) [GCC 4.8.5 20150623
(Red Hat 4.8.5-36)]


Ansible Controller:

Code: Select all
NAME="CentOS Linux"
VERSION="7 (Core)"


Destination Server:

Code: Select all
PRETTY_NAME="Debian GNU/Linux 7 (wheezy)"
NAME="Debian GNU/Linux"
VERSION_ID="7"


new-buildserver.yaml:

Code: Select all
---
# Plan
# use a staging inventory file or specify individual hosts
# copy repos
# install packages
# copy configs for installed packages
# install cpan modules
# update all the things to appropriate levels
# install mxdk
#

- hosts: buildservers
  remote_user: root
  roles:
    - buildservers


debian-7.yaml:

Code: Select all
---
    # 2018-07-02
    # Vollmer


    # Install required packages (and some perl modules) with_items using default package manager


    - name: install required packages
      package:
        name: "{{ item }}"
        state: present
      with_items:
        - alien
        - apache2
        - autofs
        - bison
        - createrepo
        - dos2unix
        - flex
#       - g++-multilib
        - git
        - html2text
        - krb5-user
#       - libc6-dev-i386
#       - libevent-dev
        - libmng1
#       - libxml++2.6-2v5
#       - libxml++2.6-dev
#       - libxml2-dev
        - libxml++2.6-2
#       - libxml2-dev:i386
#       - lib64stdc++6:i386
        - libxml2-utils
        - lzma
        - make
#       - smbfs
        - nasm
        - ntp
        - pbuilder
        - python-lxml
        - rpm2cpio
        - xsltproc
        - zip
        - libexpat1-dev
        - libssl-dev
        - zlib1g-dev
        - cpanminus
#       - update
        # The following never worked but were included in the original deployment scripts, kept here for reference
#       - lib64stdc++6:i386
#       - libxml2-dev:i386
#       - smbfs
        # It appears that Debian uses all CPAN provided modules so we do not need to install any from the package manager
      - name: install required perl modules
        package:
          name: "{{ item }}"
          state: present
#         type: package
        with_items:
          - libanydata-perl
          - libapache-asp-perl
          - libcrypt-rc4-perl
          - libdigest-sha-perl
          - libhttp-dav-perl
          - liblog-log4perl-perl
          - libsoap-lite-perl
          - libterm-shell-perl
          - libxml-dom-perl
          - libxml-libxml-perl
          - libxml-sax-perl
          - libxml-xpath-perl


ansible-playbook -i buildservers-agd new-buildserver.yaml --limit DEBIAN

I have tried `sudo apt-get install -f`.
-f, --fix-broken Fix; attempt to correct a system with broken dependencies in place.
This didn't work.

I have also tried:
sudo apt-get
update sudo
apt-get clean
sudo apt-get autoremove

Expected results are to have the packages install successfully.
JAMES_KEITH
 
Posts: 3
Joined: July 31st, 2019, 5:41 pm

Re: How do I resolve “The following packages have unmet depe

Postby fsmithred » August 4th, 2019, 12:30 pm

Depends: libexpat1 (= 2.1.0-1+deb7u2) but 2.1.0-1+deb7u4 is to be installed\

That looks like a version for wheezy (Debian 7, not Debian 10). Check your sources.list or whatever determines which repo to pull from.

Buster has libexpat1 2.2.6-2
fsmithred
 
Posts: 362
Joined: February 11th, 2011, 4:14 am

Re: How do I resolve “The following packages have unmet depe

Postby JAMES_KEITH » August 5th, 2019, 1:04 pm

Sorry, yes this is for Debian 7 wheezy! The sources.list is correct, it's pulling from:

deb http://archive.debian.org/debian wheezy main contrib
JAMES_KEITH
 
Posts: 3
Joined: July 31st, 2019, 5:41 pm

Re: How do I resolve “The following packages have unmet depe

Postby fsmithred » August 5th, 2019, 6:44 pm

I was going to suggest that you specify the version that you want, for example
Code: Select all
apt-get install libexpat1-dev=2.1.0-1+deb7u4
but instead, I'll just report weirdness that I see.

I have a wheezy installation that hasn't been updated in a long time, but I think maybe not as long as yours. Mine tells me
Code: Select all
$ apt-cache policy libexpat1-dev
libexpat1-dev:
  Installed: (none)
  Candidate: 2.1.0-1+deb7u5
  Version table:
     2.1.0-1+deb7u5 0
        500 http://security.debian.org/ wheezy/updates/main amd64 Packages
     2.1.0-1+deb7u2 0
        500 http://debian.csail.mit.edu/debian/ wheezy/main amd64 Packages


Poking around archive.debian.org, the Packages.gz file for wheezy lists 2.1.0-1+deb7u2 and I don't see a wheezy updates or security directory. And I can't find any libexpat1 packages in pool.

Not sure what to suggest. Maybe you or someone you know has a wheezy installation with the right packages sitting in /var/cache/apt/archives. Or maybe they're somewhere on the internet. Or, get the jessie sources and backport (I don't know if that would work.) Or pin the offending packages to the available version. Or the obvious, upgrade to jessie if possible.
fsmithred
 
Posts: 362
Joined: February 11th, 2011, 4:14 am

Re: How do I resolve “The following packages have unmet depe

Postby locefaj » October 11th, 2019, 11:45 am

fsmithred wrote:
Depends: libexpat1 (= 2.1.0-1+deb7u2) but 2.1.0-1+deb7u4 is to be installed\

That looks like a version for wheezy (Debian 7, not Debian 10). Check your sources.list or whatever determines which repo to pull from.

Buster has libexpat1 2.2.6-2


Debugging working?

Regards,
Sere Smith
locefaj
 
Posts: 2
Joined: October 11th, 2019, 11:13 am

Re: How do I resolve “The following packages have unmet depe

Postby linuxenthusiast » November 9th, 2019, 7:01 pm

Hi there!

I had this issue in the past and updating the sources list did the fix for me.
Just a Linux and Debian enthusiast.

I like to share articles, knowledge and pretty much everything related to the Linux world.

Sites that help me : AskUbuntu, devconnected, It's FOSS.

Message me if you need help!
linuxenthusiast
 
Posts: 1
Joined: November 9th, 2019, 6:53 pm


Return to General Questions

Who is online

Users browsing this forum: No registered users and 3 guests

x