How to uninstall PHP 7 completely? (Kali Linux/Debian)
Asked Answered
F

3

23

On my distribution of Kali (2016.2) there was a PHP package v7.0.11 pre-installed. I'd like to use version 5.6 instead. What is the best way to remove it?

I've already tried, looking for some guides online, but PHP 7 is still pretty fresh, so there are not too many threads about it, especially while using Kali. Nevertheless, I found some clues but I didn't manage to do it properly, apparently. A lot of mess with dependencies, and overall, my whole Kali install is now broken.

After purging PHP 7, I'd like to install PHP 5.6, is there an easy way to do it with apt?

Fragment answered 28/9, 2016 at 17:30 Comment(3)
I would strongly advise you to look into running contained development environments, ie with docker containers or vm's (using vagrant)? It's so much easier to spin up a specialized environment for what you're working with so you can run whatever you need on whichever versions you need - without messing with the installed OS packagesCockchafer
This should be on serverfault.com or unix.stackexchange.com. This question isn't about coding but software/server config. SO is specifically for coding issues.Bister
Thanks for the answers. Much appreciated!Fragment
M
41

I installed php 5.6 following this tutorial : http://www.drupal8.ovh/en/tutoriels/178/how-to-install-php-on-linux

To remove php 7, you can try:

sudo apt-get purge php7.0-common
Mutual answered 30/9, 2016 at 10:8 Comment(0)
G
49

This will remove all php7 version, be it php 7.0 or php 7.1 etc..

sudo apt-get purge php7.*

Garfish answered 5/9, 2018 at 21:46 Comment(0)
M
41

I installed php 5.6 following this tutorial : http://www.drupal8.ovh/en/tutoriels/178/how-to-install-php-on-linux

To remove php 7, you can try:

sudo apt-get purge php7.0-common
Mutual answered 30/9, 2016 at 10:8 Comment(0)
M
-1

I prefer to use sudo apt remove php7.0* This will remove php7 and related packages. It will also downgrade the version to the subsequent (lower) php version.

Mistrot answered 24/11, 2021 at 17:47 Comment(2)
As far as I know php apt does not exists...Explore
My bad, fixed it. Thank you.Mistrot

© 2022 - 2024 — McMap. All rights reserved.