Ubuntu удалить все php

Как полностью удалить PHP?

Я должен очистить свой сервер от пакетов PHP 5.3 (существуют многие из них), чтобы смочь скомпилировать PHP 5.2. Что самый легкий/самый безопасный метод должен избавиться от них всех?

8 ответов

Это должно полностью удалить любой пакет с именем, которое запускается с php и что-либо связанное с ним.

Вы, вероятно, захотите произвести чистку всего php* пакеты от Вашей системы. Что-то с подстановочным знаком должно работать

Можно интересоваться тем, Как откатывать к PHP 5.2 для того, куда пойти затем.

Я не рекомендую работать sudo apt-get purge php* .

Это было страшно! К счастью, я не вводил -y опция, потому что это выбрало приблизительно сотню пакетов без php на их имя.

sudo apt-get purge `dpkg -l | grep php| awk '' |tr "\n" " "` 

Как это работает:

Читайте также:  Online compiler python api

Во-первых, список пакетов сгенерирован с помощью этого ряда команд: dpkg -l | grep php| awk » |tr «\n» » » .

Подсказка: можно выполнить эту часть команды в терминале для наблюдения, какие пакеты удалить. Необходимо получить что-то как: libapache2-mod-php5 php5 php5-cli php5-common php5-json

Наконец при выполнении полной команды этот список пакетов передается sudo Кв. — получают чистку, удаляя все пакеты.

Подсказка: Если это чувствует себя более безопасным Вам, Вы могли бы столь же легко выполнить их отдельно и copy+paste список пакетов для удаления как так: sudo apt-get purge libapache2-mod-php5 php5 php5-cli php5-common php5-json

sudo apt-get -y purge libapache2-mod-php5 libapache2-mod-php5filter libexpect-php5 libgv-php5 libow-php5 php5 php5-adodb php5-auth-pam php5-cgi php5-cli php5-common php5-curl php5-dbg php5-enchant php5-exactimage php5-ffmpeg php5-fpm php5-geoip php5-gmp php5-idn php5-imagick php5-imap php5-interbase php5-intl php5-json php5-lasso php5-ldap php5-librdf php5-mapscript php5-memcache php5-memcached php5-mhash php5-midgard2 php5-ming php5-mssql php5-mysql php5-mysqlnd php5-odbc php5-pgsql php5-ps php5-pspell php5-radius php5-recode php5-remctl php5-rrd php5-sasl php5-snmp php5-sqlite php5-suhosin php5-svn php5-sybase php5-tidy php5-tokyo-tyrant php5-uuid php5-xcache php5-xdebug php5-xmlrpc php5-xsl 

В Вашем случае Вы могли искать все пакеты:

sudo aptitude search php5|awk |grep -v i386|grep -v "^A"|tr "\n" " " 

и затем произведите чистку их:

Источник

How to Uninstall PHP, Apache and MySQL on Ubuntu 20.04 LTS

This blog will help you how to uninstall or remove PHP, Apache and MySQL on Ubuntu LTS of any version. Step by step commands has been given in this blog. So if your are facing any issue I suggest you to please watch the video that is provided below.

sudo apt-get remove –purge php*
sudo apt-get purge php*
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get remove dbconfig-php
sudo apt-get dist-upgrade

Warning below command will do completely remove any package with a name that starts with php and anything related to it.

So, DON’T PRESS “y” UNTIL YOU ENSURE that in the removing packages list there are no other packages (besides related to php packages), like:

sudo apt-get remove –purge php7.2*
sudo apt-get purge php7.2*
sudo apt-get purge `dpkg -l | grep php7.2| awk '' |tr "n" " "`
whereis php
sudo rm -rf /etc/php
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get remove dbconfig-php
sudo apt-get dist-upgrade

Now we remove Apache2 from Ubuntu.

sudo service apache2 stop
sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common
sudo apt-get autoremove

Finally we are removing MySql from Ubuntu.

sudo apt-get remove –purge mysql*
sudo apt-get purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get remove dbconfig-php
sudo apt-get dist-upgrade

Removing directories from their respective default locations.

sudo rm -rf /etc/apache2
sudo rm -rf /etc/php
sudo rm -rf /var/lib/mysql
sudo rm etc/mysql

Congratulation you have successfully uninstalled or removed LAMP- PHP, apache2, and Mysql from Ubuntu Operating System. Let me know in the comment box if you are facing any difficulties while executing above commands.

Источник

How To completely uninstall PHP 8.X in ubuntu?

How To completely uninstall PHP 8.X in ubuntu?, completely uninstall PHP 8.X in ubuntu, completely uninstall PHP 8, How To completely uninstall PHP 8, uninstall PHP 8.X in ubuntu

Hello Guy How are you all? Hope You all are fine. Today in this tutorial we are going to learn about How To completely uninstall PHP in ubuntu? In this tutorial, We will Discuss all possible methods to uninstall PHP from the ubuntu server. So Let’s start this article without wasting your time.

How To completely uninstall PHP 8.X in ubuntu?

How To completely uninstall PHP in ubuntu?

To completely uninstall PHP in ubuntu Just Run purge, autoclean and autoremove command in your server, and this command will completely uninstall your PHP from your Ubuntu server. So follow all commands one by one. First Of all, You just need to run the purge command. Just run this command in your terminal: sudo apt-get purge php8.* The above command will Uninstall Any of the PHP 8.X versions of PHP installed on your Server. Now we need to cleans obsolete deb-packages to do so we need to run autoclean command: sudo apt-get autoclean After that, we need to remove orphaned packages that are no longer needed from the system so run autoremove command just like this: sudo apt-get autoremove And Now, You have Successfully Uninstalled PHP from your system. Thank You.

completely uninstall PHP in ubuntu

To completely uninstall PHP in ubuntu Just Run purge, autoclean and autoremove command in your server, and this command will completely uninstall your PHP from your Ubuntu server. So follow all commands one by one. First Of all, You just need to run the purge command. Just run this command in your terminal: sudo apt-get purge php8.* The above command will Uninstall Any of the PHP 8.X versions of PHP installed on your Server. Now we need to cleans obsolete deb-packages to do so we need to run autoclean command: sudo apt-get autoclean After that, we need to remove orphaned packages that are no longer needed from the system so run autoremove command just like this: sudo apt-get autoremove And Now, You have Successfully Uninstalled PHP from your system. Thank You.

Solution 1: Run this command

To completely uninstall PHP in ubuntu Just Run purge, autoclean and autoremove command in your server, and this command will completely uninstall your PHP from your Ubuntu server. So follow all commands one by one.

First Of all, You just need to run the purge command. Just run this command in your terminal.

The above command will Uninstall Any of the PHP 8.X versions of PHP installed on your Server. Now we need to cleans obsolete deb-packages to do so we need to run autoclean command.

After that, we need to remove orphaned packages that are no longer needed from the system so run autoremove command just like this.

You can run this all command together

sudo apt-get purge php8.* sudo apt-get autoclean sudo apt-get autoremove

And Now, You have Successfully Uninstalled PHP from your system. Thank You.

Solution 2: Follow this command

You Can use this all command to remove PHP from your system.

sudo apt-get purge `dpkg -l | grep php8.1| awk '' |tr "\n" " "` sudo apt-get purge php8.* sudo apt-get autoremove --purge whereis php sudo rm -rf /etc/php

Above all Command will completely remove PHP from your system. Thanks.

Conclusion

It’s all About this error. I hope We Have solved Your error. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Источник

How to Completely uninstall PHP and MySQL at ubuntu and install fresh PHP&MySQL in UBUNTU

How to Completely uninstall PHP and MySQL at ubuntu

Completely uninstall PHP and MySQL at ubuntu.

Completely remove php from ubuntu 17.10 using terminal using following code

1st Step:-sudo apt-get remove –purge php*
2nd Step:-sudo apt-get purge php*
3rs Step:-sudo apt-get autoremove.
4th Step:-sudo apt-get autoclean.
5th Step:-sudo apt-get remove dbconfig-php.
6th Step:-sudo apt-get dist-upgrade.

Then install fresh PHP in ur system;
7th Step:-sudo apt-get install php.

Completely remove MySql from ubuntu 17.10 using terminal using folling code

1st Step:-sudo apt-get remove –purge mysql*
2nd Step:-sudo apt-get purge mysql*
3rs Step:-sudo apt-get autoremove.
4th Step:-sudo apt-get autoclean.
5th Step:-sudo apt-get remove dbconfig-php.
6th Step:-sudo apt-get dist-upgrade.

Then install fresh Mysql in ur system;
7th Step:-sudo apt-get install mysql-server.

Источник

How to Completely uninstall PHP and MySQL at ubuntu and install fresh PHP&MySQL in UBUNTU

How to Completely uninstall PHP and MySQL at ubuntu

Completely uninstall PHP and MySQL at ubuntu.

Completely remove php from ubuntu 17.10 using terminal using following code

1st Step:-sudo apt-get remove –purge php*
2nd Step:-sudo apt-get purge php*
3rs Step:-sudo apt-get autoremove.
4th Step:-sudo apt-get autoclean.
5th Step:-sudo apt-get remove dbconfig-php.
6th Step:-sudo apt-get dist-upgrade.

Then install fresh PHP in ur system;
7th Step:-sudo apt-get install php.

Completely remove MySql from ubuntu 17.10 using terminal using folling code

1st Step:-sudo apt-get remove –purge mysql*
2nd Step:-sudo apt-get purge mysql*
3rs Step:-sudo apt-get autoremove.
4th Step:-sudo apt-get autoclean.
5th Step:-sudo apt-get remove dbconfig-php.
6th Step:-sudo apt-get dist-upgrade.

Then install fresh Mysql in ur system;
7th Step:-sudo apt-get install mysql-server.

Источник

Оцените статью