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

Asked by Kazushi Sakuraba

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

Language:
English Edit question
Status:
Solved
For:
Ubuntu cacti Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
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

Revision history for this message
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 http://ppa.launchpad.net/formorer/icinga/ubuntu xenial InRelease
Hit:2 http://ch.archive.ubuntu.com/ubuntu xenial InRelease
Hit:3 http://ch.archive.ubuntu.com/ubuntu xenial-security InRelease
Hit:4 http://ch.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:5 https://packagecloud.io/grafana/stable/debian jessie InRelease
Hit:6 http://apt.postgresql.org/pub/repos/apt xenial-pgdg InRelease
Get:7 http://security.ubuntu.com/ubuntu 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
php7.0-mbstring:
  Installed: (none)
  Candidate: 7.0.15-0ubuntu0.16.04.4
  Version table:
     7.0.15-0ubuntu0.16.04.4 500
        500 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages
        100 /var/lib/dpkg/status
     7.0.4-7ubuntu2 500
        500 http://ch.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
php7.0-common:
  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 http://ch.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     7.0.15-0ubuntu0.16.04.4 500
        500 http://ch.archive.ubuntu.com/ubuntu xenial-security/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
     7.0.4-7ubuntu2 500
        500 http://ch.archive.ubuntu.com/ubuntu xenial/main amd64 Packages

Revision history for this message
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

Revision history for this message
Kazushi Sakuraba (kimura+) said :
#4

As follows:
 cat -n /etc/apt/sources.list
     1 #------------------------------------------------------------------------------#
     2 # OFFICIAL UBUNTU REPOS #
     3 #------------------------------------------------------------------------------#
     4
     5
     6 ###### Ubuntu Main Repos
     7 deb http://ch.archive.ubuntu.com/ubuntu/ xenial main universe
     8 # deb-src http://ch.archive.ubuntu.com/ubuntu/ xenial main
     9 #deb http://archive.ubuntu.com/ubuntu/ xenial-proposed restricted main multiverse universe
    10
    11 ###### Ubuntu Update Repos
    12 deb http://ch.archive.ubuntu.com/ubuntu/ xenial-security main
    13 deb http://ch.archive.ubuntu.com/ubuntu/ xenial-updates main
    14 # deb-src http://ch.archive.ubuntu.com/ubuntu/ xenial-security main
    15 # deb-src http://ch.archive.ubuntu.com/ubuntu/ xenial-updates main
    16
    17 deb http://security.ubuntu.com/ubuntu xenial-security main
    18 # deb-src http://security.ubuntu.com/ubuntu xenial-security main
    19 deb http://security.ubuntu.com/ubuntu xenial-security universe
    20 # deb-src http://security.ubuntu.com/ubuntu xenial-security universe
    21 deb http://security.ubuntu.com/ubuntu xenial-security multiverse
    22 # deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse
    23 deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main
    24 # deb-src http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main
    25
    26 ###### Grafana
    27 deb https://packagecloud.io/grafana/stable/debian/ jessie main

Revision history for this message
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.

Revision history for this message
Kazushi Sakuraba (kimura+) said :
#6

Thanks Manfred, that solved my problem!

Revision history for this message
Kazushi Sakuraba (kimura+) said :
#7

Thanks Manfred Hampl, that solved my question.