Potential troubles removing PHP-CGI from all PHP versions

SYSTEM INFORMATION
OS type and version: Ubuntu Linux 20.04.5 LTS
Webmin version: 2.001
Virtualmin version: 7.2-1

Greetings guys and thank you for your great work on this project,

Used Virtualmin as a development experiment for a couple of years now and finally got to build a real server,
Went installing Virtualmin as described in the docs, added PHP 7.4 and 8.1,
Decided that only FPM execution mode is needed and went to apt remove the cgi packages from both versions,
Removing it from PHP7.3 went alright, but when doing apt remove php8.1-cgi I get this info:

Seems to render everything installed by Virtualmin unnecessary, and the question is, would that be alright? Trying not to break things here while understanding what is the underlying mechanism of this.

Looking forward for your opinions! :slight_smile:

Its only removing 3 packages, i can’t see that harming anything.

It’s removing virtualmin-lamp-stack, which is the metapackage we provide that installs all the dependencies. Once it’s gone, an apt autoremove could destroy your system. That’s something to be aware of.

I never use autoremove, personally, and consider it a dangerous misfeature that should not exist, but I know many people habitually do use it to keep their system clean and tiday…and we have seen people destroy their systems with these exact steps.

I’m a little confused though, as I think we made all of the PHP dependencies into Recommends in Virtualmin 7 (assuming you used the current Virtualmin 7 installer…if you used the Virtualmin 6 installer, I guess it was a Depends, which is a hard dependency). Removing php-cgi should no longer remove virtualmin-lamp-stack.

Thanks @Joe for info,
I don’t remember which installer version it was but I do know that the install was done on 30th of June, any idea where I can find what version was last back then?
And if it was v6 is there a way to set php-cgi as a Recommend now?

install.sh has a VER string, but June would definitely be version 6.

I’m not confident there is an easy/safe way to switch to the Virtualmin 7 version of virtualmin-lamp-stack, as your version depended on mysql and the new one Recommends mariadb. I think you can probably switch, but I haven’t tested.

The next release of the virtualmin-lamp-stack packages will have mariadb | mysql, and also in the Recommends instead of Depends, which makes it safer to move from Virtualmin 6 repo to the Virtualmin 7 repo…but, none of that is tested or documented (it’s stupid simple, but it’s probably not obvious if you don’t know how all the pieces fit together, so we need to write some docs or a script to help switch).

In the meantime, just don’t run autoremove (again, I would never run autoremove on a production server). Or, manually mark all of the packages you use installed by running apt install <list of packages you don't want autoremove to remove>. That will not install anything (assuming it’s already installed), but it will mark them as “manually installed” so they will not be removed by autoremove when packages that depend on them, like virtualmin-lamp-stack, go away go away.

This is all stuff Ubuntu/Debian users ought to get familiar with. Your package manager is among the most powerful and potentially dangerous pieces of software on your system. You ought to know what it’s doing and why.

1 Like

That’s so true, and not only about Ubuntu/Debian; I was breaking CentOSes with yum years ago until I got my grip on it - and that doesn’t even have an autoremove option, at least without explicitly enabling it in confs or with a plugin :innocent:

But the info above is gold, thank you again @Joe, apt install <list of packages..> seems a good option and will test; then I noticed autoremove can be disabled as well via its conf files … need to investigate the implications of that too.

Too good this machine is not production yet, so I still have a couple of weeks to ruin it then start from scratch (if it comes to that) :see_no_evil:

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