0

I am in the process of upgrading to Debian Bullseye. When doing apt full-upgrade I see that apache2 is going to be installed. I do not want apache on my system, I have nginx already running.

How can I prevent this?

Is it safe to do apt-mark hold apache2, apt-mark hold apache2-bin, etc. and then do the upgrade?


Update:

Ok, from the Bullseye Release Notes I learned that "It is desirable to remove any holds before upgrading."

And when I do apt -o Debug::pkgDepCache::AutoInstall=1 -sV full-upgrade I get the following:

[...]
Installing php7.4 as Hängt ab von of php
Installing libapache2-mod-php7.4 as Hängt ab von of php7.4
  Installing php7.4-cli as Hängt ab von of libapache2-mod-php7.4
    Installing php7.4-json as Hängt ab von of php7.4-cli
    Installing php7.4-opcache as Hängt ab von of php7.4-cli
    Installing php7.4-readline as Hängt ab von of php7.4-cli
  Installing [b]apache2-bin[/b] as Hängt ab von of [b]libapache2-mod-php7.4[/b]
    Installing libapr1 as Hängt ab von of apache2-bin
    Installing libaprutil1 as Hängt ab von of apache2-bin
    Installing libaprutil1-dbd-sqlite3 as Hängt ab von of apache2-bin
    Installing libaprutil1-ldap as Hängt ab von of apache2-bin
    Installing libjansson4 as Hängt ab von of apache2-bin
  Installing [b]apache2 as Empfiehlt of libapache2-mod-php7.4[/b]
    Installing apache2-data as Hängt ab von of apache2
    Installing apache2-utils as Hängt ab von of apache2
    [...]

(sorry for the stupid german language snippets, "Hängt ab von" means depends, "Empfiehlt" means recommends)

When I add --no-install-recommends it gives:

Installing php7.4 as Hängt ab von of php
    Installing libapache2-mod-php7.4 as Hängt ab von of php7.4
      Installing php7.4-cli as Hängt ab von of libapache2-mod-php7.4
        Installing php7.4-json as Hängt ab von of php7.4-cli
        Installing php7.4-opcache as Hängt ab von of php7.4-cli
        Installing php7.4-readline as Hängt ab von of php7.4-cli
      Installing apache2-bin as Hängt ab von of libapache2-mod-php7.4
        Installing libapr1 as Hängt ab von of apache2-bin
        Installing libaprutil1 as Hängt ab von of apache2-bin
        Installing libaprutil1-dbd-sqlite3 as Hängt ab von of apache2-bin
        Installing libaprutil1-ldap as Hängt ab von of apache2-bin
        Installing libjansson4 as Hängt ab von of apache2-bin

So adding --no-install-recommends, I could live with that, only having package apache2-bin lying around there. But how the hell can php(7.4) recommend a full apache to be installed while having nginx already on the system??? (nginx was installed via standard repo and will be going to be updated when doing the full-upgrade)

archygriswald
  • 143
  • 1
  • 11
  • Is nginx one of these 3 Debian-packaged: [nginx](https://packages.debian.org/buster/nginx), or installed using a non official Debian repository (eg: from upstream), or installed without using Debian's packaging system at all? All this can matter for a dist upgrade. – A.B May 21 '22 at 08:19
  • @A.B thanks for looking into it; I installed nginx normally via standard repo (see my update above) – archygriswald May 21 '22 at 16:51
  • 1
    hint about the language: `export LANG=C.UTF-8` before a command to cut/paste on Stackexchange. About apache: there's `libapache2-mod-php7.4` probably pulled by `libapache2-mod-php` and who know what else pulls `libapache2-mod-php`. you can specify something like `apache2-bin-` or `libapache2-mod-php-` or both (or more. Note the minus added at the end of the package name) as additional entry after `full-upgrade` and the resolver mught select something else instead or just complain on a conflict that can help you further. Anyway I have no further idea. – A.B May 21 '22 at 18:10
  • @A.B found a solution thanks to your help, Thank You very much!!! – archygriswald May 22 '22 at 13:48

1 Answers1

2

Upgrade successful!

I am on 11.3 now, nginx & php7.4 are running, and not a single apache package on my system. It was sufficient to

apt full-upgrade libapache2-mod-php7.4-

Explanation:

As one can see on https://packages.debian.org/bullseye/php7.4, a dependency of php7.4 is libapache2-mod-php7.4 OR php7.4-fpm. And php-fpm was on my system before and it is going to be updated now. So I can exclude libapache2-mod-php7.4 from the upgrade (by adding the "minus" at the end) and the dependencies for php7.4 are still met. And by doing this I can avoid apt from pulling a whole apache server to my system.

Thanks to all for looking into my problem. Especially @A.B thank you so much, your hint with the libapache2-mod-php- was the key to the solution!!!

archygriswald
  • 143
  • 1
  • 11
  • WARNING to others: This solution worked in my case, but the apt man says about the added minus after a package name: "install, remove, purge (apt-get(8)) - Performs the requested action on one or more packages specified via regex(7), glob(7) or exact match. The requested action can be overridden for specific packages by append a plus (+) to the package name to install this package or a minus (-) to remove it." So be careful not to remove packages that you still need. – archygriswald May 25 '22 at 16:26