Can't install cacti after upgrading to 7.0.15-0ubuntu0.16.04.4, reason: cacti : Depends: php-mbstring

Asked by Kazushi Sakuraba on 2017-06-30

Hi all

I just did an sudo apt-get dist-upgrade and in the process the following packages were removed:

The following packages will be REMOVED:
  cacti cacti-spine php7.0-mbstring

Now when I try to install cacti by
sudo apt-get install cacti cacti-spine -y

I get the following:
The following packages have unmet dependencies:
 cacti : Depends: php7.0-mbstring
E: Unable to correct problems, you have held broken packages.

When trying to install php-mbstring I get the following:
The following packages have unmet dependencies:
 php7.0-mbstring : Depends: php7.0-common (= 7.0.15-0ubuntu0.16.04.4) but 7.0.18-0ubuntu0.16.04.1 is to be installed
E: Unable to correct problems, you have held broken packages.

Is this a bug?

Question information

English Edit question
Ubuntu cacti Edit question
No assignee Edit question
Solved by:
Manfred Hampl
Last query:
Last reply:
Manfred Hampl (m-hampl) said : #1

For diagnostic purposes please provide the output of the following commands:

uname -a
lsb_release -crid
sudo apt-get update
apt-cache policy php7.0-mbstring php7.0-common

Kazushi Sakuraba (kimura+) said : #2

Hi Manfred, here you go:

uname -a
Linux ray 4.4.0-45-generic #66-Ubuntu SMP Wed Oct 19 14:12:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

lsb_release -crid
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial

 sudo apt-get update
[sudo] password for rayadmin:
Hit:1 xenial InRelease
Hit:2 xenial InRelease
Hit:3 xenial-security InRelease
Hit:4 xenial-updates InRelease
Hit:5 jessie InRelease
Hit:6 xenial-pgdg InRelease
Get:7 xenial-security InRelease [102 kB]
Fetched 102 kB in 24s (4'148 B/s)
Reading package lists... Done

apt-cache policy php7.0-mbstring php7.0-common
  Installed: (none)
  Candidate: 7.0.15-0ubuntu0.16.04.4
  Version table:
     7.0.15-0ubuntu0.16.04.4 500
        500 xenial-security/universe amd64 Packages
        100 /var/lib/dpkg/status
     7.0.4-7ubuntu2 500
        500 xenial/universe amd64 Packages
  Installed: 7.0.18-0ubuntu0.16.04.1
  Candidate: 7.0.18-0ubuntu0.16.04.1
  Version table:
 *** 7.0.18-0ubuntu0.16.04.1 500
        500 xenial-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     7.0.15-0ubuntu0.16.04.4 500
        500 xenial-security/main amd64 Packages
        500 xenial-security/main amd64 Packages
     7.0.4-7ubuntu2 500
        500 xenial/main amd64 Packages

Manfred Hampl (m-hampl) said : #3

I assume that you are missing the xenial-updates/universe repository as one of the package sources.

What is the output of
cat -n /etc/apt/sources.list

Kazushi Sakuraba (kimura+) said : #4

As follows:
 cat -n /etc/apt/sources.list
     1 #------------------------------------------------------------------------------#
     3 #------------------------------------------------------------------------------#
     6 ###### Ubuntu Main Repos
     7 deb xenial main universe
     8 # deb-src xenial main
     9 #deb xenial-proposed restricted main multiverse universe
    11 ###### Ubuntu Update Repos
    12 deb xenial-security main
    13 deb xenial-updates main
    14 # deb-src xenial-security main
    15 # deb-src xenial-updates main
    17 deb xenial-security main
    18 # deb-src xenial-security main
    19 deb xenial-security universe
    20 # deb-src xenial-security universe
    21 deb xenial-security multiverse
    22 # deb-src xenial-security multiverse
    23 deb xenial-pgdg main
    24 # deb-src xenial-pgdg main
    26 ###### Grafana
    27 deb jessie main

Best Manfred Hampl (m-hampl) said : #5

Edit that file with a command like

sudo gedit /etc/apt/sources.list

and append the word " universe" to lines 12, 13, 14 and 15
save the file and close the editor, then run the command

sudo apt-get update
and then try installing cacti again.

Kazushi Sakuraba (kimura+) said : #6

Thanks Manfred, that solved my problem!

Kazushi Sakuraba (kimura+) said : #7

Thanks Manfred Hampl, that solved my question.