Upgrade Debian 9 to 10 - PHP 7.0 Issues

I am testing an upgrade for a production server from Debian 9 to 10. There are a lot of changes in Debian 10 but I managed to upgrade without any issues.

Debian 9 was running PHP 7.0 and Debian 10 is running PHP 7.3. Some PHP 7.0 packages were removed in the upgrading process and they cannot be installed anymore. Virtualmin-lamp-stack is depending on PHP7.0 but I would like to remove 7.0 from the server completely. I did this by using “dpkg -r --force-depends php7.0-common” command but this creates more issue. On one hand I cannot install PHP7.0 again, on the other hand Virtualmin needs it.

Here is the message in Terminal window:

root@server:/etc# apt install virtualmin-lamp-stack
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
virtualmin-lamp-stack : Depends: php7.0-common but it is not installable
                     Depends: php7.0-cgi but it is not installable
                     Depends: php7.0-fpm but it is not installable
                     Depends: php7.0-cli but it is not installable
                     Recommends: libdbd-mysql-perl but it is not going to be installed
                     Recommends: php-mcrypt
                     Recommends: php7.0-mysql but it is not installable
                     Recommends: php7.0-mcrypt but it is not installable
                     Recommends: php7.0-mbstring but it is not installable
                     Recommends: unrar but it is not installable
E: Unable to correct problems, you have held broken packages.

How can I “detach” Virtualmin from asking PHP7.0 dependencies and make it ask for PHP7.3?

@ADDISON74,

You should be able to upgrade to latest version of PHP to address dependencies, and make sure you’ve upgraded all other software as well.

Generally speak even if it’s technically possible, it is not recommended to upgrade between major OS versions on a server install. The recommended path is to backup websites, deploy new OS version, then import backed up sites.

Major releases come with major changes and simply upgrading often leads to left over pieces and an unstable installation.

If you require assistance, let me know.

Best Regards,
Peter Knowles | TPN Solutions

Thank you for your reply but please read again the initial post. I already did the upgrade from Debian 9 to 10 without any issues.

The only problem is that Virtualmin still depends on PHP 7.0 from Debian 9 not PHP 7.3 from Debian 10. The main goal is to remove PHP 7.0 without affecting virtualmin-lamp-stack package dependencies. Using “dpkg -r --force-depends php7.0-common” command will create a big problem. In case I want to install or upgrade an packages I am pushed to re-install the deleted dependencies (PHP 7.0).

A variant I tested after posting this issue was to remove virtualmin-lamp-stack with all packages installed then I re-installed virtualmin using install.sh script. With a few minor issues everything was full functioning after installing. This time the virtualmin-lamp-stack dependencies are related to PHP 7.3 only.

Does anyone know how to change/modify the dependencies for virtualmin-lamp-stack after a major upgrade? In fapt to “detach” old package (PHP 7.0) an “attach” new package (PHP 7.3)? This helps me to remove PHP 7.0 from the system which is obsolete and not receiving updates since 2019.

@ADDISON74,

Check the file…

/etc/apt/sources.list.d/virtualmin.list

In one of the lines does it read something like…

deb http://software.virtualmin.com/vm/6/gpl/apt virtualmin-stretch main

If so, you are polling the wrong repo for your now “buster” distro. Try changing the “virtualmin-stretch” to “virtualmin-buster”, then run “sudo apt update && sudo apt upgrade”

Best Regards,
Peter Knowles | TPN Solutions

Thank you for your reply.

Indeed I missed to change the repo for Virtualmin in the file you mentioned. After Virtualmin installation I kept all repo’s in /etc/apt/source.list file only. This is the place where I changed all records from stretch to buster before upgrading. It seems with its upgrades over the years Virtualmin created its own source list file. I will pay attention on this folder from now on. The upgrade went smooth and I was able to remove PHP 7.0 without any issues this time.

For Debian users who are upgrading from 9 to 10 please read this note carefully. After upgrading process Debian will ask you to autoremove some packages which are no longer in use. Pay attention to the list. Astonishing MariaDB 10.3 which is default in Debian 10 and installed in the upgrade process over 10.1 version will be in the list! Fortunately if you do the mistake to remove it you can re-install the package without any issues. In my case autoremoving did not delete /etc/mysql and /var/lib/mysql folders.

Seeing the website is working with the new configuration even the upgrade process went smooth my choice is to install everything from scratch to avoid any issue. Once Debian 11 will be released I will do the step on it and take the advantage of 4 years of security upgrades.

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.