Unable to update from 5.0 to 5.1.x (php7.2-intl)

Please follow the below template, it will help us to help you!

Expected Behaviour:

Upgrading pihole from 5.0 to 5.1.x

Actual Behaviour:

This seems deja vu of the issue I had when I first tried to upgrade to 5.0. (Thread: Can't update to 5.0 (php7.2-intl))

I restarted pihole after receiving the same errors as the previous thread. Re-ran pihole -up and I get:

[i] Checking for php7.2-intl (will be installed)
[i] Processing apt-get install(s) for: php7.2-intl, please wait...

E: Unable to correct problems, you have held broken packages.

Unable to complete update, please contact Pi-hole Support

Debug Token:

https://tricorder.pi-hole.net/31tuhfmtec

You need to fix the broken packages. Run sudo apt update and inspect the results. If no errors, then continue to sudo apt upgrade and see if all the packages update.

No errors, updated ~36 packages.
Restarted and am still getting the same error as listed above.

Did none of the actions from your previous post resolve this issue now?

They did not, I attempted to re-run the steps multiple times with no luck.

Just keeps circling back to this error:

The following packages have unmet dependencies:
php-intl : Depends: php7.2-intl but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Try to troubleshoot which package are held and broken.

https://askubuntu.com/a/223267

@MichaIng

This is php-intl issue.

Yes this is potentially fixed with Pi-hole 5.1 where the meta package is not attempted to be installed anymore. Although, currently now sure if the update calls the new script or the old?

Did you try the prior fix again?

sed -i 's/php-intl/${phpVer}-intl/' /etc/.pihole/automated\ install/basic-install.sh

Otherwise which PHP package are installed now?

dpkg -l | grep php

Re ran that fix and now I get this error again:

[i] Processing apt-get install(s) for: php7.2-intl, please wait...

E: Unable to correct problems, you have held broken packages.

Unable to complete update, please contact Pi-hole Support

dpkg -l | grep php
ii php-cgi 1:7.2+60ubuntu1 all server-side, HTML-embedded scripting language (CGI binary) (default)
ii php-common 1:60ubuntu1 all Common files for PHP packages
ii php-sqlite3 1:7.2+60ubuntu1 all SQLite3 module for PHP [default]
ii php7.2-cgi 7.2.24-0ubuntu0.18.04.6 amd64 server-side, HTML-embedded scripting language (CGI binary)
ii php7.2-cli 7.2.24-0ubuntu0.18.04.6 amd64 command-line interpreter for the PHP scripting language
ii php7.2-common 7.2.24-0ubuntu0.18.04.6 amd64 documentation, examples and common module for PHP
rc php7.2-intl 7.2.3-1ubuntu1 amd64 Internationalisation module for PHP
ii php7.2-json 7.2.24-0ubuntu0.18.04.6 amd64 JSON module for PHP
ii php7.2-opcache 7.2.24-0ubuntu0.18.04.6 amd64 Zend OpCache module for PHP
ii php7.2-readline 7.2.24-0ubuntu0.18.04.6 amd64 readline module for PHP
ii php7.2-sqlite3 7.2.24-0ubuntu0.18.04.6 amd64 SQLite3 module for PHP
ii php7.2-xml 7.2.24-0ubuntu0.18.04.6 amd64 DOM, SimpleXML, WDDX, XML, and XSL module for PHP

There are leftover config files from a php7.2-intl package with non-matching version string. I recognised those two conflicting PHP7.2 versions on your system already last time, wherever this comes from. Please try to install it manually, purging the leftover first:

apt purge php7.2-intl
apt update
apt install php7.2-intl

Although... now I see and verified the issue that you faced before with this inconsistent Ubuntu repo: Can't update to 5.0 (php7.2-intl) - #33 by MichaIng
It's still the same, the package lists contain PHP 7.2.3 packages while there are 7.2.24 packages stored in the pool. Strangely you're now on the other side of the issue:

  • Last time you had PHP 7.2.3 while the intl meta package wanted to pull only the intl package as 7.2.24.
  • Now all your packages (however this was possible with the apparent lists) are PHP 7.2.24 but only intl is missing and the meta package wants to install the 7.2.3 package which fails for the same reason, just the other way round...
  • If the list contains non-matching packages, then meta or non-meta probably doesn't make a difference anyway...

The package website still shows 7.2.24 for x86 systems and 7.2.3 for ARMs: Ubuntu – Error
But that does not match the list files I just downloaded and scraped for amd64, all 7.2.3... a mess that they seem to switch back and forth or what.

Ah forget about the repo, install the correct version manually:

cd /tmp
wget http://archive.ubuntu.com/ubuntu/pool/universe/p/php7.2/php7.2-intl_7.2.24-0ubuntu0.18.04.6_amd64.deb
dpkg -i php7.2-intl_7.2.24-0ubuntu0.18.04.6_amd64.deb
rm php7.2-intl_7.2.24-0ubuntu0.18.04.6_amd64.deb
phpenmod intl

The Pi-hole installer/updater is satisfied then as well.

Again, thank you! Update proceeded as expected after the above commands.

I'm hoping that this won't rear it's ugly head again with the next update.

Great. Pi-hole at least will now pull the exact package, although the culprit here seems to have been the Ubuntu repo. Not sure why they mix two versions in their repo.

Out of interest, did apt install php7.2-intl succeed in the first place, or was the manual download of the 7.2.24 package required?

Manual installation was needed for it to succeed.

I see now that 7.2.24 comes from security suite. Probably you have the security repo/suite applied but only with main component and not universe (where PHP intl is placed). Please compare your /etc/apt/sources.list with this:

deb http://archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse 
deb http://archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse 
deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse 
  • restricted and/or multiverse are probably missing and not required.
  • Important is for the four components (main, restricted, universe and multiverse), if any of those is applied to one of bionic, bionic-security or bionic-updates suites, is should be applied to all three suites (their related sources.list lines).
  • PHP might be not the only case where some packages are available in one component (e.g. main) while other plugins/modules/extension are available in another component (e.g. universe). Then, if an update is pushed through either bionic-security or bionic-updates suite, and you have not all components added to those, APT wants to pull the updated packages from main component while for those from universe component the updates are not seen since the component has only been added to the main bionic suite, hence the version missmach.

Here are the contents for my /etc/aptsources.list

deb http://archive.ubuntu.com/ubuntu bionic main universe
deb http://archive.ubuntu.com/ubuntu bionic-security main
deb http://archive.ubuntu.com/ubuntu bionic-updates main

In this case should I update the the other two with universe as well?

Exactly, change it to:

deb http://archive.ubuntu.com/ubuntu bionic main universe
deb http://archive.ubuntu.com/ubuntu bionic-security main universe
deb http://archive.ubuntu.com/ubuntu bionic-updates main universe

fantastic. thanks. that worked.