我使用命令从计算机上卸载了php5
sudo apt-get -y purge php.*
运行此命令将在终端显示此消息:
Errors were encountered while processing: php5-memcache php5-memcached
所以我尝试卸载memcache:
sudo apt-get remove php-memcache
它向我显示了一条消息,它找不到memcache软件包:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php-memcache
然后进行memcached:
apt-get remove php5-memcached
它向我抛出有关php中缺少依赖项的信息:
The following packages have unmet dependencies.
php5-memcache : Depends: php5-common (>= 4.3.11) but it is not going to be installed
Depends: php-pear (>= 1.4.0~b1) but it is not going to be installed
Depends: phpapi-20121212
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
跑步
apt-get -f install
再次抛出有关删除内存缓存的错误。
据我正确理解,我犯了一个错误,我没有在卸载php5之前删除memcache?我现在能做什么?我需要再次安装php吗?当我尝试安装缺少的依赖项时,我收到有关另一个缺少的软件包的消息。使用“ apt-get”时,是否应该缺少自动添加/删除的软件包?
通过谷歌搜索我发现,问题可能出在使用不适合我的系统的错误存储库。如何检测哪些存储库适合我的系统安装/卸载用于卸载Memcache的适当软件包?谢谢你的帮助
我已经将这样的php存储库添加到我的系统中:http : //ppa.launchpad.net/ondrej/php5/ubuntu http://ppa.launchpad.net/ondrej/php5/ubuntu http://ppa.launchpad.net/ ondrej / php-7.0 / ubuntu http://ppa.launchpad.net/ondrej/php-7.0/ubuntu
我尝试根据@oerdnj用dpkg删除memcache,但仍然出现一些错误:
tomas@Toshiba ~ $ sudo dpkg --purge php5-memcache
(Reading database ... 275094 files and directories currently installed.)
Removing php5-memcache (3.0.8-4build1) ...
/var/lib/dpkg/info/php5-memcache.prerm: 9: /var/lib/dpkg/info/php5- memcache.prerm: php5dismod: not found
dpkg: error processing package php5-memcache (--purge):
subprocess installed pre-removal script returned error exit status 127
Errors were encountered while processing:
php5-memcache
我还尝试了线程解决方案如何删除/安装未完全安装的软件包?但它向我显示了相同的错误:
tomas@Toshiba ~ $ sudo apt-get install --reinstall dpkg
[sudo] password for tomas:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies.
php5-memcache : Depends: php5-common (>= 4.3.11) but it is not going to be installed
Depends: php-pear (>= 1.4.0~b1) but it is not going to be installed
Depends: phpapi-20121212
php5-memcached : Depends: libmemcached10 but it is not going to be installed
Depends: php5-common (>= 5.2.0) but it is not going to be installed
Depends: php5-common (< 6.0.0) but it is not going to be installed
Depends: php-pear (>= 1.4.0~b1) but it is not going to be installed
Depends: phpapi-20121212
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
如果您的系统处于apt-get
几乎无法使用的状态,则可以尝试使用dpkg
来删除受影响的软件包,在这种情况下,请尝试:
sudo dpkg --purge php5-memcache
dpkg
是一种用于处理软件包的低级工具,它并没有尽力使所有软件包保持一致的状态。
由于php5dismod
您的系统缺少该文件,因此我建议您手动删除/var/lib/dpkg/info/php5-memcache.prerm
和/var/lib/dpkg/info/php5-memcache.postrm
文件,并/etc/php5/
手动清理内存缓存配置的痕迹(可能会在此处找到主要的memcache.ini
符号链接20-memcache.ini
)。
注意:如果您不完全了解自己在做什么,请不要尝试从Internet上尝试其他随机事情,否则可能会破坏系统。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句