鍍金池/ 問答/PHP  Linux  網(wǎng)絡(luò)安全/ php安裝錯誤

php安裝錯誤

當(dāng)我執(zhí)行

apt update && apt upgrade

的時候,不小心選錯了選項,導(dǎo)致PHP升級失敗

Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up libapache2-mod-php7.2 (7.2.7-1+ubuntu18.04.1+deb.sury.org+1) ...
ucfr: Attempt from package libapache2-mod-php7.2  to take /etc/php/7.2/apache2/php.ini away from package php7.2-fpm
ucfr: Aborting.
dpkg: error processing package libapache2-mod-php7.2 (--configure):
 installed libapache2-mod-php7.2 package post-installation script subprocess returned error exit status 4
Errors were encountered while processing:
 libapache2-mod-php7.2
E: Sub-process /usr/bin/dpkg returned an error code (1)

的時候,除了提示
而且后面再使用apt的時候也是這些提示

而且怎么弄都沒用
并且執(zhí)行

apt-get autoremove
apt autoremove
apt-get clean
apt clean

dpkg -l |grep ^rc|awk '{print $2}' |xargs dpkg -P

之后還是提示同樣的錯誤,并且還多了以下的提示

dpkg: error processing package libapache2-mod-php7.2 (--configure):
 installed libapache2-mod-php7.2 package post-installation script subprocess returned error exit status 4
Errors were encountered while processing:
 libapache2-mod-php7.2
E: Sub-process /usr/bin/dpkg returned an error code (1)
dpkg: error: --purge needs at least one package name argument

Type dpkg --help for help about installing and deinstalling packages [*];
Use 'apt' or 'aptitude' for user-friendly package management;
Type dpkg -Dhelp for a list of dpkg debug flag values;
Type dpkg --force-help for a list of forcing options;
Type dpkg-deb --help for help about manipulating *.deb files;

Options marked [*] produce a lot of output - pipe it through 'less' or 'more' !

請問各位大佬們,我該怎么辦

# uname -a
Linux dz6 4.4.0-122-generic #146-Ubuntu SMP Mon Apr 23 15:34:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
# lsb_release -a
LSB Version:    core-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch
Distributor ID:    Ubuntu
Description:    Ubuntu 18.04 LTS
Release:    18.04
Codename:    bionic
回答
編輯回答
茍活

把出錯的包卸了重裝,autoremve不加包名時只會刪除自動選擇的沒有被依賴的包,不會刪除手動安裝的包。你需要加上包名。

2018年7月31日 07:28
編輯回答
檸檬藍

自己編譯安裝吧,或者用docker拉個鏡像來。以前寫的一個shell:LnmpShell

2018年6月9日 05:17