我使用 Apache 和 PHP 的自定义编译版本,并且想知道如何卸载 Fedora 13 附带的默认版本。
这些的二进制文件位于,/usr/bin
而我的编译的二进制文件分别位于/usr/local/apache
& /usr/local/php
。
作为使用 PHP 的网络服务器,此设置可以正常工作,但是当从命令行执行脚本时,除非我指定已编译 PHP 的绝对路径,否则路径/usr/bin
优先,因为它在路径搜索顺序中被首先找到。
更新 - 卸载日志
[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
答案1
只需使用包管理器(yum)即可删除它们。
yum erase httpd php
这应该可以摆脱它们两个,但您可能需要检查是否安装了其他 PHP 包,有些可能不会与主包一起删除。
更新:
您可以获取所有已下载软件包的列表(我认为),然后针对 PHP 进行过滤,例如:
rpm -qa | grep php
这将为您提供包含单词 PHP 的所有包的列表
现在,如果您正在谈论 php 二进制文件,我认为那应该是 php-cli 包。