My situation happened on a Raspberry with Raspbian Stretch installed, I had added PHP7.0 repository from sury.org quite a while back and when by chance today I went to open PiHole admin page from my laptop it simply wouldn’t load.
Google what’s up, I found out lighttpd was maybe the culprit, look around and noticed it wasn’t installed, and couldn’t be installed with the error:
lighttpd : Depends: libssl1.1 (>= 1.1.0) but it is not going to be installed
I then discovered that said libssl1.1 library off sury.org, coming together with the PHP distro, broke lighttpd.
I removed the repository source from
/etc/apt/sources.list.d/php.list (your filename may vary) and issued a sudo apt-get update followed by a dist-upgrade but that didn’t solve anything.
I couldn’t find for the life of me a way to simply exchange the libssl1.1 package (which was kept from the sury.org repository even after removing its source) to the original repository version, and
sudo apt-get remove libsll1.1
wanted me to remove also ALL the packages that depended on this library. And they were a LOT.
Like hell I wanted to do that!
Well I tried
sudo apt-get install --reinstall libssl1.1
hoping it would get rid of the messy libssl1.1 exchanging it with the official repository one, but that also gave an error:
Reinstallation of libssl1.1 is not possible, it cannot be downloaded.
Sooooo I was getting out of options and very annoyed.
I thought, why not letting the frigging apt remove all those packages? I can always install them later on… I hope…
So I copied the list of the packages that were to be removed off putty window and into notepad++, crossed my fingers and let apt remove everything.
After that was done during an extremely long and suffered delay, I had to do
sudo apt-get install <paste big-ass list of packages here>
In my case, it didn’t work out that simply at the first try, I got some CRC mismatch somewhere so they were not installed all together.
But I issued the command with less packages listed, beginning with apache2 php7.0 mysql-server transmission-cli samba python somethingIcannotreallyrecallnow, and then reissued the first command with all the list again to fill in the blanks.
It installed everything piece by piece, and lighttpd with it as well.
Since apt-get actually removes those packages without purging them (unless you ask it to purge libssl1.1 which isn’t a good idea) their settings are kept and reinstalling the packages will restore the system to the previous state.
At least it did for me, since the system came back to normal after a reboot.