Page 1 of 1

PHP 7.0 at end of life.

Posted: Mon Mar 04, 2019 5:16 am
by plutocrat
So I wasn't aware that PHP 7.0 is now officially dead, but it seems to be the case http://php.net/supported-versions.php . This is not great news if you're on Ubuntu 16, as that's the default install of PHP, so if you haven't already done so, its probably time to move.

Luckily the instructions are not hard to follow and appear all around the internet. Basically you add a separate repository. Adding this will now actually automatically move you up to PHP 7.2. You can optionally choose to install PHP 7.3.

However, now you have a system with three versions of PHP installed. In the interests of keeping things tidy, I was looking at uninstalling php7.0, but because it was the original version installed on Ubuntu 16, it seems that things depend on it. I got a list of installed PHP 7.0 packages with

Code: Select all

dpkg --get-selections | grep php7.0 | grep install | awk '{print $1}' | tr '\n' ' '
So far, so good, but when you try to use that to remove packages:

Code: Select all

apt remove $( dpkg --get-selections | grep php7.0 | grep install | awk '{print $1}' | tr '\n' ' ' )
You get this:

Code: Select all

The following packages were automatically installed and are no longer required: libmcrypt4 php-auth 
php-auth-sasl php-crypt-chap php-db php-imap php-intl php-ldap php-log php-mail php-mail-mime php-mail-mimedecode 
php-mdb2 php-net-ldap2 php-net-ldap3 php-net-sieve php-net-smtp php-net-socket php-pspell php-soap 
php7.2-imap php7.2-intl php7.2-ldap php7.2-pspell php7.2-soap
Use 'apt autoremove' to remove them.
The following packages will be REMOVED: libapache2-mod-php7.0 php-mcrypt php7.0 php7.0-cgi php7.0-cli 
php7.0-common php7.0-gd php7.0-imap php7.0-intl php7.0-json php7.0-ldap php7.0-mbstring php7.0-mcrypt 
php7.0-mysql php7.0-opcache php7.0-pspell php7.0-readline php7.0-xml roundcube-core roundcube-plugins
Now first of all, I don't want to remove roundcube, so I'd like to avoid that. Secondly, it seems like autoremove (should I choose to run it after), will also take out a bunch of important-looking packages.
Has anyone been through this?
What is the way to avoid removing and re-installing roundcube (which is never going to end well).

Re: PHP 7.0 at end of life.

Posted: Mon Mar 04, 2019 5:19 am
by plutocrat
A bit more info. apt-cache depends roundcube-core gives the following output, which seems to agree that its happy with any version of PHP being present, and either apache or nginx. But in reality, removing php7.0* will remove roundcube too.

Code: Select all

apt-cache depends roundcube-core
roundcube-core
  Depends: dbconfig-common
 |Depends: debconf
  Depends: <debconf-2.0>
    cdebconf
    debconf
  Depends: ucf
 |Depends: libapache2-mod-php
    libapache2-mod-php5.6
    libapache2-mod-php7.0
    libapache2-mod-php7.1
    libapache2-mod-php7.2
    libapache2-mod-php7.3
  Depends: php
    php5.6
    php7.0
    php7.1
    php7.2
    php7.3
  Depends: php-mcrypt
    php5.6-mcrypt
    php7.0-mcrypt
    php7.1-mcrypt
  Depends: php-intl
    php5.6-intl
    php7.0-intl
    php7.1-intl
    php7.2-intl
    php7.3-intl
 |Depends: php-json
    php5.6-json
    php7.0-json
    php7.1-json
    php7.2-json
    php7.3-json
  Depends: php-common
  Depends: php-cli
    php5.6-cli
    php7.0-cli
    php7.1-cli
    php7.2-cli
    php7.3-cli
  Depends: php-auth
  Depends: php-net-smtp
  Depends: php-net-socket
  Depends: php-mail-mime
  Depends: php-mail-mimedecode
  Depends: libmagic1
 |Depends: roundcube-mysql
 |Depends: roundcube-sqlite3
  Depends: roundcube-pgsql
  Breaks: roundcube-plugins-extra
 |Recommends: apache2
 |Recommends: lighttpd
 |Recommends: spawn-fcgi
 |Recommends: php-fpm
    php5.6-fpm
    php7.0-fpm
    php7.1-fpm
    php7.2-fpm
    php7.3-fpm
  Recommends: <httpd-cgi>
    tntnet
    aolserver4-core
    aolserver4-daemon
    apache2
    lighttpd
    mini-httpd
    nginx-core
    nginx-extras
    nginx-full
    nginx-light
    ocsigenserver
    yaws
  Recommends: php-gd
    php5.6-gd
    php7.0-gd
    php7.1-gd
    php7.2-gd
    php7.3-gd
  Recommends: php-pspell
    php5.6-pspell
    php7.0-pspell
    php7.1-pspell
    php7.2-pspell
    php7.3-pspell
  Recommends: php-net-ldap3
  Recommends: php-net-sieve
  Suggests: php-auth-sasl
  Suggests: php-crypt-gpg
  Suggests: roundcube-plugins
  Replaces: roundcube-plugins-extra

Re: PHP 7.0 at end of life.

Posted: Mon Mar 04, 2019 5:42 am
by plutocrat
Trying to remove each package on its own with this code

Code: Select all

for PACKAGE in libapache2-mod-php7.0 php7.0 php7.0-cgi php7.0-cli php7.0-common php7.0-curl php7.0-gd php7.0-imap php7.0-intl php7.0-json php7.0-ldap php7.0-mbstring php7.0-mcrypt php7.0-mysql php7.0-opcache php7.0-pspell php7.0-readline php7.0-soap php7.0-xml ; do echo "=== removing $PACKAGE" ; apt remove $PACKAGE ; done
Gives these results

Code: Select all

=== removing libapache2-mod-php7.0
The following packages will be REMOVED:
  libapache2-mod-php7.0

=== removing php7.0
The following package was automatically installed and is no longer required:
  libapache2-mod-php7.0
Use 'apt autoremove' to remove it.
The following packages will be REMOVED:
  php7.0

=== removing php7.0-cgi
The following packages will be REMOVED:
  php7.0-cgi

=== removing php7.0-cli
The following packages were automatically installed and are no longer required:
  php7.0-opcache php7.0-readline
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  libapache2-mod-php7.0 php7.0 php7.0-cgi php7.0-cli

=== removing php7.0-common
The following packages were automatically installed and are no longer required:
  libmcrypt4 php-auth php-auth-sasl php-crypt-chap php-db php-imap php-intl php-ldap php-log php-mail php-mail-mime php-mail-mimedecode
  php-mdb2 php-net-ldap2 php-net-ldap3 php-net-sieve php-net-smtp php-net-socket php-pspell php-soap php7.2-imap php7.2-intl
  php7.2-ldap php7.2-pspell php7.2-soap
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  libapache2-mod-php7.0 php-mcrypt php7.0 php7.0-cgi php7.0-cli php7.0-common php7.0-gd php7.0-imap php7.0-intl php7.0-json php7.0-ldap
  php7.0-mbstring php7.0-mcrypt php7.0-mysql php7.0-opcache php7.0-pspell php7.0-readline php7.0-xml roundcube-core roundcube-plugins

=== removing php7.0-curl
Package 'php7.0-curl' is not installed, so not removed

=== removing php7.0-gd
The following packages will be REMOVED:
  php7.0-gd

=== removing php7.0-imap
The following packages will be REMOVED:
  php7.0-imap

=== removing php7.0-intl
The following packages will be REMOVED:
  php7.0-intl

=== removing php7.0-json
The following packages were automatically installed and are no longer required:
  php7.0-opcache php7.0-readline
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  libapache2-mod-php7.0 php7.0 php7.0-cgi php7.0-cli php7.0-json

=== removing php7.0-ldap
The following packages will be REMOVED:
  php7.0-ldap

=== removing php7.0-mbstring
The following packages will be REMOVED:
  php7.0-mbstring

=== removing php7.0-mcrypt
The following packages were automatically installed and are no longer required:
  libmcrypt4 php-auth php-auth-sasl php-crypt-chap php-db php-imap php-intl php-ldap php-log php-mail php-mail-mime php-mail-mimedecode
  php-mdb2 php-net-ldap2 php-net-ldap3 php-net-sieve php-net-smtp php-net-socket php-pspell php-soap php7.0-imap php7.0-intl
  php7.0-ldap php7.0-pspell php7.2-imap php7.2-intl php7.2-ldap php7.2-pspell php7.2-soap
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  php-mcrypt php7.0-mcrypt roundcube-core roundcube-plugins

=== removing php7.0-mysql
The following packages will be REMOVED:
  php7.0-mysql

=== removing php7.0-opcache
The following package was automatically installed and is no longer required:
  php7.0-readline
Use 'apt autoremove' to remove it.
The following packages will be REMOVED:
  libapache2-mod-php7.0 php7.0 php7.0-cgi php7.0-cli php7.0-opcache

=== removing php7.0-pspell
The following packages will be REMOVED:
  php7.0-pspell

=== removing php7.0-readline
The following packages have unmet dependencies:
 php7.0-cli : Depends: php7.0-readline but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

=== removing php7.0-soap
Package 'php7.0-soap' is not installed, so not removed

=== removing php7.0-xml
The following packages will be REMOVED:
  php7.0-xml
So it seems that the baddies are php7.0-common and php7.0-mcrypt