Sudo apt autoremove that break my nextcloud

Nextcloud version (eg, 20.0.5): 22.2.3
Operating system and version (eg, Ubuntu 20.04): Debian 11
Apache or nginx version (eg, Apache 2.4.25): 2.4.52
PHP version (eg, 7.4): 8.1.1

The issue you are facing:

when i sudo apt-get upgrade my server, i got this message :

Les paquets suivants ont été installés automatiquement et ne sont plus nécessaires :
  libapache2-mod-php8.0 linux-image-5.10.0-9-amd64 php8.0 php8.0-curl php8.0-gd php8.0-mbstring php8.0-mysql php8.0-zip
Veuillez utiliser « sudo apt autoremove » pour les supprimer.

that means that these packets are not useful anymore right ?

but if i do autoremove, then i can’t access anymore my interface (404 page not found) and i can’t sync nextcloud over my devices.

For now i’ve managed to restore a previous backup so my instance is working well until i forgot about that and i do the mistake to autoremove in few weeks…

Thanks a lot for your help.

In supported Debian releases you do not found this versions of php.

Please post your debian sources e.g. sources.list.

Debian Bullseye:
https://packages.debian.org/bullseye/php (PHP 7.4)
https://packages.debian.org/bullseye/libapache2-mod-php (PHP 7.4)

That is the latest official version for Debian Stable.
Please do not use sources outside from the debian repository.

Do you really use Debian 11 (Bullseye)? or another linux distribution?
Post
uname -a

Have had the same problem when few PHP version installed parallel, so used by NC only were marked with no dependencies and removed :smile:

Check from step 4

Linux Debian-Serveur-Matt 5.10.0-11-amd64 #1 SMP Debian 5.10.92-1 (2022-01-18) x86_64 GNU/Linux

image

thanks for your time

Any help with this subject ?

THAT might be the inital problem… as even NC23 isn’t yet compatible with php above 8.0x

You can cetainly do that. If you know what you are doing and if you know what do to if apt misbehaves and thinks it has to uninstall the whole desktop because you want to update Steam :wink:

@grosJambon33000 You have two options: Either you install the PHP packages from the stable repository (bullseye) without version specification or you install explicitly certain versions from the backports repository (bullseye-backports), like you probably did. Why Apt then thinks it it has to “upgrade” explicitly installed package versions with “other” versions, and even uninstall some packages in this specific situation, I do not know. I guess it could have something to do how it handels priorities between diffrent repositories. So either comment the backports repo out and reinstall everything without using backports, or read up here` on how it all works with diffrent repos… Keyword: apt pinning

Plus make notes on how you installed and configured PHP. When something similar happened to me a while ago on Ubuntu, I just purged php completely including configs and then reinstalled it using my instructions. 5 mins later everything worked like before.

thanks for your explanation. i will try what you said and come back here to let you know.

1 Like

So i comment the backports repo, and then reinstall

  libapache2-mod-php8.0 linux-image-5.10.0-9-amd64 php8.0 php8.0-curl php8.0-gd php8.0-mbstring php8.0-mysql php8.0-zip

and now no more auto-remove message asking me to delete those guys.

and about the backports repo ? i should never use them again ?

Thanks a lot.

Let me put it this way… As long as you do not absolutely need a newer PHP version, it’s probably best to just use the packages from stable. Also PHP with all it’s dependencies and diffrent modules already brings a certain complexity with it, and working with multiple repos and versions dosn’t necessarily make it less complex. :wink: But it can be done obviously… Here the link to the backports instructions if you want to read more about it: https://backports.debian.org/Instructions/

Glad it worked out :slight_smile: