Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I use custom compiled versions of both Apache and PHP and was wondering how to uninstall the default versions that came with my copy of Fedora 13.

The binaries for these are located in /usr/bin whereas binaries for my compiles are as /usr/local/apache & /usr/local/php respectively.

As a webserver with PHP this setup works fine, but when it comes to executing scripts from command line, unless I specify absolute path to the compiled PHP, the one in /usr/bin takes precedence as it's found first in the path search order.

UPDATE - Uninstall Log

[root@dogmatix ~]# which php
/usr/bin/php
[root@dogmatix ~]# which httpd
/usr/sbin/httpd
[root@dogmatix ~]# yum erase httpd php
Loaded plugins: presto, refresh-packagekit, rhnplugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package httpd.i686 0:2.2.15-1.fc13 set to be erased
--> Processing Dependency: httpd-mmn = 20051115 for package: mod_perl-2.0.4-10.fc13.i686
--> Processing Dependency: httpd-mmn = 20051115 for package: mod_python-3.3.1-11.i686
--> Processing Dependency: httpd-mmn = 20051115 for package: 1:mod_ssl-2.2.15-1.fc13.i686
--> Processing Dependency: httpd for package: 1:mod_ssl-2.2.15-1.fc13.i686
--> Processing Dependency: httpd = 2.2.15-1.fc13 for package: 1:mod_ssl-2.2.15-1.fc13.i686
--> Processing Dependency: httpd for package: webalizer-2.21_02-3.i686
--> Processing Dependency: httpd for package: BackupPC-3.1.0-13.fc13.noarch
--> Processing Dependency: httpd >= 2.2.0 for package: gnome-user-share-2.30.0-1.fc13.i686
--> Processing Dependency: httpd = 2.2.15-1.fc13 for package: httpd-manual-2.2.15-1.fc13.noarch
--> Processing Dependency: httpd >= 2.0.40 for package: mod_python-3.3.1-11.i686
--> Processing Dependency: httpd for package: 5:system-config-httpd-1.4.6-1.fc13.noarch
---> Package php.i686 0:5.3.3-1.fc13 set to be erased
--> Running transaction check
---> Package BackupPC.noarch 0:3.1.0-13.fc13 set to be erased
---> Package gnome-user-share.i686 0:2.30.0-1.fc13 set to be erased
---> Package httpd-manual.noarch 0:2.2.15-1.fc13 set to be erased
---> Package mod_perl.i686 0:2.0.4-10.fc13 set to be erased
---> Package mod_python.i686 0:3.3.1-11 set to be erased
---> Package mod_ssl.i686 1:2.2.15-1.fc13 set to be erased
---> Package system-config-httpd.noarch 5:1.4.6-1.fc13 set to be erased
---> Package webalizer.i686 0:2.21_02-3 set to be erased
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================
 Package                      Arch            Version                   Repository                                             Size
====================================================================================================================================
Removing:
 httpd                        i686            2.2.15-1.fc13             @anaconda-InstallationRepo-201005130056.i386          2.7 M
 php                          i686            5.3.3-1.fc13              @updates                                              3.3 M
Removing for dependencies:
 BackupPC                     noarch          3.1.0-13.fc13             @anaconda-InstallationRepo-201005130056.i386          2.2 M
 gnome-user-share             i686            2.30.0-1.fc13             @anaconda-InstallationRepo-201005130056.i386          1.1 M
 httpd-manual                 noarch          2.2.15-1.fc13             @anaconda-InstallationRepo-201005130056.i386          3.5 M
 mod_perl                     i686            2.0.4-10.fc13             @anaconda-InstallationRepo-201005130056.i386          6.0 M
 mod_python                   i686            3.3.1-11                  @anaconda-InstallationRepo-201005130056.i386          1.5 M
 mod_ssl                      i686            1:2.2.15-1.fc13           @anaconda-InstallationRepo-201005130056.i386          181 k
 system-config-httpd          noarch          5:1.4.6-1.fc13            @anaconda-InstallationRepo-201005130056.i386          2.3 M
 webalizer                    i686            2.21_02-3                 @anaconda-InstallationRepo-201005130056.i386          329 k

Transaction Summary
====================================================================================================================================
Remove       10 Package(s)
Reinstall     0 Package(s)
Downgrade     0 Package(s)

Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing        : httpd-manual-2.2.15-1.fc13.noarch                                                                           1/10 
  Erasing        : BackupPC-3.1.0-13.fc13.noarch                                                                               2/10 
  Erasing        : 5:system-config-httpd-1.4.6-1.fc13.noarch                                                                   3/10 
  Erasing        : php-5.3.3-1.fc13.i686                                                                                       4/10 
  Erasing        : mod_perl-2.0.4-10.fc13.i686                                                                                 5/10 
  Erasing        : 1:mod_ssl-2.2.15-1.fc13.i686                                                                                6/10 
  Erasing        : webalizer-2.21_02-3.i686                                                                                    7/10 
  Erasing        : mod_python-3.3.1-11.i686                                                                                    8/10 
  Erasing        : gnome-user-share-2.30.0-1.fc13.i686                                                                         9/10 
  Erasing        : httpd-2.2.15-1.fc13.i686                                                                                   10/10 

Removed:
  httpd.i686 0:2.2.15-1.fc13                                         php.i686 0:5.3.3-1.fc13                                        

Dependency Removed:
  BackupPC.noarch 0:3.1.0-13.fc13                gnome-user-share.i686 0:2.30.0-1.fc13      httpd-manual.noarch 0:2.2.15-1.fc13     
  mod_perl.i686 0:2.0.4-10.fc13                  mod_python.i686 0:3.3.1-11                 mod_ssl.i686 1:2.2.15-1.fc13            
  system-config-httpd.noarch 5:1.4.6-1.fc13      webalizer.i686 0:2.21_02-3                

Complete!
[root@dogmatix ~]# which php
/usr/bin/php
share|improve this question

1 Answer 1

up vote 2 down vote accepted

Simply use the package manager (yum) to remove them.

yum erase httpd php

This should get rid of both of them, you might want to check if there's other PHP packages installed though, some might not be removed with the main package.

Update:

You can get a list of all packages ever downloaded (I think) and then filter that for PHP, like:

rpm -qa | grep php

This would give you a list of all packages containing the word PHP

Now if you're talking about the php binary I think that would be the php-cli package.

share|improve this answer
    
Xeross: Thanks dude! I managed to get rid of Apache cleanly, but PHP still remains :o Please see the output above. –  miCRoSCoPiCeaRthLinG Jun 10 '11 at 17:02
1  
See updated answer :) –  Xeross Jun 10 '11 at 17:08
    
Yup! That did it :) You rock dude!! –  miCRoSCoPiCeaRthLinG Jun 11 '11 at 3:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.