apt install apache2-dev fails in Ubuntu

Asked 1 years ago, Updated 1 years ago, 328 views

What do you want to do

Install apache2-dev on Ubuntu

Prerequisites

I tried to install apache2-dev using apt in Ubuntu, but an error occurred.

Problems/Error Messages you are experiencing

$sudo apt update
$ sudo apt upgrade
$ sudo apt install apache2-dev
Loading package list... Done
Creating dependency tree...completed        
Reading state information...completed        
There was a package that could not be installed.Possibly.
Requested no circumstances or (using unstable distribution)
If so) the required package has not yet been created or moved from Incoming
It may be that it is not moving.
The following information may help resolve this issue:

The following packages have unmet dependencies:
 libaprutil1-dev:dependent:libldap2-dev
E—The problem cannot be resolved.There is a broken Prohibit Change package.

Tried

$sudo apt install-y libldap2-dev
Loading package list... Done
Creating dependency tree...completed        
Reading state information...completed        
There was a package that could not be installed.Possibly.
Requested no circumstances or (using unstable distribution)
If so) the required package has not yet been created or moved from Incoming
It may be that it is not moving.
The following information may help resolve this issue:

The following packages have unmet dependencies:
 libldap-dev:dependent: libldap-2.5-0 (=2.5.11+dfsg-1 to exp1ubuntu 3.1) But 2.5.13+dfsg-0ubuntu 0.22.04.1 is about to be installed
E—The problem cannot be resolved.There is a broken Prohibit Change package.

$ sudo apt install-y libldap-dev
Loading package list... Done
Creating dependency tree...completed        
Reading state information...completed        
There was a package that could not be installed.Possibly.
Requested no circumstances or (using unstable distribution)
If so) the required package has not yet been created or moved from Incoming
It may be that it is not moving.
The following information may help resolve this issue:

The following packages have unmet dependencies:
 libldap-dev:dependent: libldap-2.5-0 (=2.5.11+dfsg-1 to exp1ubuntu 3.1) But 2.5.13+dfsg-0ubuntu 0.22.04.1 is about to be installed
E—The problem cannot be resolved.There is a broken Prohibit Change package.

$ sudo apt install-y libldap2 = 2.5.0
Loading package list... Done
Creating dependency tree...completed        
Reading state information...completed        
Package libldap2 is not available, but is referenced by another package.
This is a missing, obsolete, or different source of the package.
This means that it is only available from the .
However, the following packages will replace:
  libldap-2.5-0slapd: i386 libldap-2.5-0: i386slapd

E: 'libldap2' version '2.5.0' not found

sudo apt install-y libldap-dev = 2.5.0
Loading package list... Done
Creating dependency tree...completed        
Reading state information...completed        
The package libldap-dev is not available, but is referenced by another package.
This is a missing, obsolete, or different source of the package.
This means that it is only available from the .
However, the following packages will replace:
  libldap-dev —i386

E: 'libldap-dev' version '2.5.0' not found


I looked up the error content on the web, but I couldn't find it.

Supplementary information (for example, FW/Tool Version)

$cat/etc/issue
Ubuntu 22.04.1 LTS\n\l

$ apache2-version
Server version: Apache/2.4.52 (Ubuntu)
Server build: 2023-03-08T17:32:01


How can we solve this problem?
I would appreciate it if you could let me know.
Thank you for your cooperation.

linux ubuntu apache apt

2023-03-12 18:22

1 Answers

Ubuntu 22.04 LTS The latest is as follows (as of this answer)

$lsb_release-a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.2 LTS
Release—22.04
Codename: jammy

Maybe raising Ubuntu 22.04.1 to Ubuntu 22.04.2 will solve this problem

Also, the following askubuntu should be helpful from the error message

The Q&A includes the following (and other items):

  • Do you have any hold packages?

    dpkg --get-selections | grep hold
  • /etc/apt/sources.list has no software source for a different Ubuntu release than your current Ubuntu release

    • Ubuntu 22.04 should be "jammy" and other (for example) "Impish Indri", "Kinetic Kudu" and others not included
  • Try installing with the
  • aptitude command

Are there any hold packages that exist?

dpkg -- get-selections | grep hold

Verify that /etc/apt/sources.list does not have a software source for a different Ubuntu release than your current Ubuntu release

  • Ubuntu 22.04 should be "jammy" and other (for example) "Impish Indri", "Kinetic Kudu" and others not included

Try installing with the aptitude command

Note:
① Example of how aptitude worked Response to broken dependencies in Ubuntu
example using apt install --install-recommendsWorkaround the apt "Broken Prohibit Change Package"


2023-03-12 22:14

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.