I can't install php7.0-mbstring:

The following packages have unmet dependencies: php7.0-mbstring : Depends: php7.0-common (= 7.0.19-1) but 7.0.20-1~dotdeb+8.2 is to be installed E: Unable to correct problems, you have held broken packages.


deb http://debian.man.ac.uk/debian/ stretch main deb-src http://debian.man.ac.uk/debian/ stretch main

deb http://security.debian.org/ stretch/updates main contrib deb-src http://security.debian.org/ stretch/updates main contrib

deb http://ftp.at.debian.org/debian/ stretch-updates main contrib non-free deb-src http://ftp.at.debian.org/debian/ stretch-updates main contrib non-free

deb http://download.webmin.com/download/repository sarge contrib

apt-cache policy output:

Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 http://download.webmin.com/download/repository sarge/contrib amd64 Packages
     release v=3.1,o=Jamie Cameron,a=stable,n=sarge,l=Webmin,c=contrib,b=amd64
     origin download.webmin.com
 500 http://ftp.at.debian.org/debian stretch-updates/main amd64 Packages
     release o=Debian,a=stable-updates,n=stretch-updates,l=Debian,c=main,b=amd64
     origin ftp.at.debian.org
 500 http://security.debian.org stretch/updates/contrib amd64 Packages
     release v=9,o=Debian,a=stable,n=stretch,l=Debian-Security,c=contrib,b=amd64
     origin security.debian.org
 500 http://security.debian.org stretch/updates/main amd64 Packages
     release v=9,o=Debian,a=stable,n=stretch,l=Debian-Security,c=main,b=amd64
     origin security.debian.org
 500 http://debian.man.ac.uk/debian stretch/main amd64 Packages
     release v=9.3,o=Debian,a=stable,n=stretch,l=Debian,c=main,b=amd64
     origin debian.man.ac.uk

apt-cache policy php7.0-common output:

  Installed: 7.0.20-1~dotdeb+8.2
  Candidate: 7.0.20-1~dotdeb+8.2
  Version table:
  *** 7.0.20-1~dotdeb+8.2 100
        100 /var/lib/dpkg/status
      7.0.19-1 500
        500 http://debian.man.ac.uk/debian stretch/main amd64 Packages
  • @GAD3R There are no files inside /etc/apt/sources.list.d
    – Shade
    Dec 19 '17 at 15:50
  • 1
    Mixing stretch and sarge and dotdeb repositories is a very bad idea. Dec 19 '17 at 16:04

You have a version of php7.0-common from dotdeb, which your list of repositories no longer knows about, and which is preventing you from installing the Debian 9 PHP packages. You should remove that, along with any package depending on it, and install php7.0-common from the Debian repositories:

sudo apt remove php7.0-common
sudo apt install php7.0-mbstring

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.