1

I tried to remove PHP from ubuntu:

sudo aptitude purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "`

But without results.

when I run php -v in terminal I get PHP 5.3.25-dev

How I can remove ?

Thanks

3
  • What do you get if you simply run dpkg -l | grep php
    – Panther
    Apr 26, 2013 at 18:47
  • when I run 'dpkg -l | grep php' I received new empty line
    – user117845
    Apr 26, 2013 at 19:50
  • How did you install it ? from source ?
    – Panther
    Apr 26, 2013 at 20:06

2 Answers 2

0

You did install the PHP5 from the source. PHP 5.3.25 was never part of Ubuntu release.

Hopefully if you did install it into a /usr/local, it could be removed by just going through the files in the /usr/local directories and remove files which seems to be belonging to PHP. If you did install PHP to /usr, then it could be more complicated, and it might require the original source directory where you have compiled the PHP.

If you still have PHP source directory you might want to try doing 'make uninstall' from the source directory, or if that command doesn't work, you could do another 'make install', noting the files which gets installed and removing them manually later.

However this is not really an Ubuntu related question.

It's never a good idea to install software directly from the sources, if you don't know exactly what you are doing.

P.S.: You might want to try the poor man's man "packaging" system - stow - next time to manage installed files in a sane way.

1
  • your answer is opened my eyes and I solved. Thanks @oerdnj
    – user117845
    May 1, 2013 at 10:32
0
whereis php
php: /usr/local/bin/php /usr/local/lib/php
sudo rm -rf /usr/local/bin/php /usr/local/lib/php

You must log in to answer this question.