Score:0

Using Ubuntu 21.10 and trying to install php-dev, getting libpcre2-dev : Depends: libpcre2-8-0

us flag

can someone help me? I am trying to install php-dev using this command sudo apt install php-dev, but I am getting this error

The following packages have unmet dependencies:  libpcre2-dev : Depends: libpcre2-8-0 (= 10.37-0ubuntu2) but
10.38-2+ubuntu21.04.1+deb.sury.org+1 is to be installed
                Depends: libpcre2-16-0 (= 10.37-0ubuntu2) but 10.38-2+ubuntu21.04.1+deb.sury.org+1 is to be installed
                Depends: libpcre2-32-0 (= 10.37-0ubuntu2) but 10.38-2+ubuntu21.04.1+deb.sury.org+1 is to be installed E: Unable to correct problems, you have held broken packages.

I tried to reinstall and install php again, but did not work.

I am using Ubuntu 21.10 with

PHP 8.0.8 (cli) (built: Sep 11 2021 04:17:39) ( NTS ) Copyright (c) The PHP Group Zend Engine v4.0.8, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.8, Copyright (c), by Zend Technologies

apt-cache policy php-dev gets me this

php-dev:   Installed: (none)   Candidate: 2:8.0+82~0build1   Version table:
     2:8.0+82~0build1 500
        500 http://bg.archive.ubuntu.com/ubuntu impish/main amd64 Packages
        500 http://bg.archive.ubuntu.com/ubuntu impish/main i386 Packages

output from egrep -r deb /etc/apt/sources.list /etc/apt/sources.list.d is

/etc/apt/sources.list:deb http://bg.archive.ubuntu.com/ubuntu/ impish main restricted
/etc/apt/sources.list:deb-src http://bg.archive.ubuntu.com/ubuntu/ impish main universe restricted multiverse #Added by software-properties
/etc/apt/sources.list:deb http://bg.archive.ubuntu.com/ubuntu/ impish-updates main restricted
/etc/apt/sources.list:deb-src http://bg.archive.ubuntu.com/ubuntu/ impish-updates main universe restricted multiverse #Added by software-properties
/etc/apt/sources.list:deb http://bg.archive.ubuntu.com/ubuntu/ impish universe
/etc/apt/sources.list:deb http://bg.archive.ubuntu.com/ubuntu/ impish-updates universe
/etc/apt/sources.list:deb http://bg.archive.ubuntu.com/ubuntu/ impish multiverse
/etc/apt/sources.list:deb http://bg.archive.ubuntu.com/ubuntu/ impish-updates multiverse
/etc/apt/sources.list:deb http://bg.archive.ubuntu.com/ubuntu/ impish-backports main restricted universe multiverse
/etc/apt/sources.list:deb-src http://bg.archive.ubuntu.com/ubuntu/ impish-backports main restricted universe multiverse #Added by software-properties
/etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu impish-security main restricted
/etc/apt/sources.list:deb-src http://security.ubuntu.com/ubuntu impish-security main universe restricted multiverse #Added by software-properties
/etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu impish-security universe
/etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu impish-security multiverse
/etc/apt/sources.list:# (e.g. netinst, live or single CD). The matching "deb cdrom"
/etc/apt/sources.list.d/dart_stable.list.distUpgrade:deb [arch=amd64] https://storage.googleapis.com/download.dartlang.org/linux/debian stable main # забранен при надграждане до groovy забранен при надграждане до hirsute
/etc/apt/sources.list.d/sublime-text.list.save:deb https://download.sublimetext.com/ apt/stable/ # забранен при надграждане до impish
/etc/apt/sources.list.d/nordvpn.list:deb https://repo.nordvpn.com/deb/nordvpn/debian stable main # забранен при надграждане до groovy забранен при надграждане до hirsute забранен при надграждане до impish
/etc/apt/sources.list.d/dropbox.list.distUpgrade:deb [arch=i386,amd64] http://linux.dropbox.com/ubuntu disco main # забранен при надграждане до groovy забранен при надграждане до hirsute
/etc/apt/sources.list.d/dart_stable.list.save:deb [arch=amd64] https://storage.googleapis.com/download.dartlang.org/linux/debian stable main # забранен при надграждане до groovy забранен при надграждане до hirsute забранен при надграждане до impish
/etc/apt/sources.list.d/spotify.list.distUpgrade:deb http://repository.spotify.com stable non-free
/etc/apt/sources.list.d/nordvpn.list.save:deb https://repo.nordvpn.com/deb/nordvpn/debian stable main # забранен при надграждане до groovy забранен при надграждане до hirsute забранен при надграждане до impish
/etc/apt/sources.list.d/teamviewer.list.dpkg-old:deb http://linux.teamviewer.com/deb stable main # забранен при надграждане до groovy
/etc/apt/sources.list.d/linrunner-ubuntu-tlp-focal.list.distUpgrade:deb http://ppa.launchpad.net/linrunner/tlp/ubuntu focal main
/etc/apt/sources.list.d/archive_uri-https_repo_protonvpn_com_debian-groovy.list.distUpgrade:deb https://repo.protonvpn.com/debian unstable main # забранен при надграждане до hirsute
/etc/apt/sources.list.d/sublime-text.list:deb https://download.sublimetext.com/ apt/stable/ # забранен при надграждане до impish
/etc/apt/sources.list.d/slack.list.distUpgrade:deb https://packagecloud.io/slacktechnologies/slack/debian/ jessie main
/etc/apt/sources.list.d/steam.list.distUpgrade:deb [arch=amd64,i386] https://repo.steampowered.com/steam/ stable steam # забранен при надграждане до groovy забранен при надграждане до hirsute
/etc/apt/sources.list.d/dart_stable.list:deb [arch=amd64] https://storage.googleapis.com/download.dartlang.org/linux/debian stable main # забранен при надграждане до groovy забранен при надграждане до hirsute забранен при надграждане до impish
/etc/apt/sources.list.d/nordvpn.list.distUpgrade:deb https://repo.nordvpn.com/deb/nordvpn/debian stable main # забранен при надграждане до groovy забранен при надграждане до hirsute
/etc/apt/sources.list.d/sublime-text.list.distUpgrade:deb https://download.sublimetext.com/ apt/stable/
/etc/apt/sources.list.d/skype-stable.list.distUpgrade:deb [arch=amd64] https://repo.skype.com/deb stable main
/etc/apt/sources.list.d/google-chrome.list.distUpgrade:deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main # забранен при надграждане до groovy забранен при надграждане до hirsute
/etc/apt/sources.list.d/audio-recorder-ubuntu-ppa-groovy.list.distUpgrade:deb http://ppa.launchpad.net/audio-recorder/ppa/ubuntu/ hirsute main # забранен при надграждане до hirsute
/etc/apt/sources.list.d/dropbox.list:deb [arch=i386,amd64] http://linux.dropbox.com/ubuntu disco main # забранен при надграждане до groovy забранен при надграждане до hirsute забранен при надграждане до impish
/etc/apt/sources.list.d/spotify.list.save:deb http://repository.spotify.com stable non-free # забранен при надграждане до impish
/etc/apt/sources.list.d/git-core-ubuntu-ppa-groovy.list.distUpgrade:deb http://ppa.launchpad.net/git-core/ppa/ubuntu/ hirsute main # забранен при надграждане до hirsute
/etc/apt/sources.list.d/google-chrome.list:deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main # забранен при надграждане до groovy забранен при надграждане до hirsute забранен при надграждане до impish
/etc/apt/sources.list.d/spotify.list:deb http://repository.spotify.com stable non-free # забранен при надграждане до impish
/etc/apt/sources.list.d/ondrej-ubuntu-php-hirsute.list.distUpgrade:deb http://ppa.launchpad.net/ondrej/php/ubuntu/ hirsute main
/etc/apt/sources.list.d/ondrej-ubuntu-php-hirsute.list.distUpgrade:# deb-src http://ppa.launchpad.net/ondrej/php/ubuntu/ hirsute main
/etc/apt/sources.list.d/google-chrome.list.save:deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main # забранен при надграждане до groovy забранен при надграждане до hirsute забранен при надграждане до impish
/etc/apt/sources.list.d/slack.list:deb https://packagecloud.io/slacktechnologies/slack/debian/ jessie main # забранен при надграждане до impish
/etc/apt/sources.list.d/slack.list.save:deb https://packagecloud.io/slacktechnologies/slack/debian/ jessie main # забранен при надграждане до impish
/etc/apt/sources.list.d/graphics-drivers-ubuntu-ppa-hirsute.list.distUpgrade:deb http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu/ hirsute main
/etc/apt/sources.list.d/graphics-drivers-ubuntu-ppa-hirsute.list.distUpgrade:# deb-src http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu/ hirsute main
/etc/apt/sources.list.d/dropbox.list.save:deb [arch=i386,amd64] http://linux.dropbox.com/ubuntu disco main # забранен при надграждане до groovy забранен при надграждане до hirsute забранен при надграждане до impish
/etc/apt/sources.list.d/steam.list:deb [arch=amd64,i386] https://repo.steampowered.com/steam/ stable steam # забранен при надграждане до groovy забранен при надграждане до hirsute забранен при надграждане до impish
/etc/apt/sources.list.d/steam.list.save:deb [arch=amd64,i386] https://repo.steampowered.com/steam/ stable steam # забранен при надграждане до groovy забранен при надграждане до hirsute забранен при надграждане до impish
nobody avatar
gh flag
Please add `egrep -r deb /etc/apt/sources.list /etc/apt/sources.list.d` to your question.
Dimitar avatar
us flag
@nobody, done..
nobody avatar
gh flag
Do you need ppa:ondrej/php ppa? If not `sudo ppa-purge ppa:ondrej/php`
Dimitar avatar
us flag
Why I am getting `sudo: ppa-purge: command not found`
nobody avatar
gh flag
`sudo apt install ppa-purge`
Dimitar avatar
us flag
`Warning: Could not find package list for PPA: ondrej php` after running `sudo ppa-purge ppa:ondrej/php`
Dimitar avatar
us flag
Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/130727/discussion-between-dimitar-and-nobody).
Score:2
gh flag

we could revert packages from ppa's that are newer as from ubuntu sources with apt pinning.

sudo apt install  apt-show-versions

To identify how many packages are involved run

 apt-show-versions | fgrep newer

If are not many packages listed you have a good chance to fix brocken depencecies.

community wiki

The right values you can get from the output from

apt-cache policy

Note: Make a backup first and draw an iso so you can make a clean install. apt pinning is the last ditch to set things right It can work but it is not guaranteed

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.