我在使用 php 和 phpMyAdmin 时遇到了问题,现在,在手动删除 php、apache2 后,当我从软件中心安装任何东西时,都会收到失败消息。
我尝试卸载 libapache2-mod-php5,因为这似乎是问题之一:我收到一条包含以下信息的失败消息:
installArchives() failed: (Reading database ...
dpkg: warning: files list file for package 'mysql-client-5.5' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-server-core-5.5' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'apache2.2-bin' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'php5-cli' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'apache2.2-common' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-server-5.5' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'apache2-utils' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libmysqlclient18:i386' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libmysqlclient18:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'php5-common' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'apache2-mpm-prefork' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libdbd-mysql-perl' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libqt4-sql-mysql:i386' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libqt4-sql-mysql:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-common' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-client-core-5.5' missing; assuming package has no files currently installed
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 295374 files and directories currently installed.)
Removing libapache2-mod-php5 ...
egrep: /etc/apache2/mods-enabled/*.load: No such file or directory
Module php5 already disabled
Selecting previously unselected package libapache2-mod-php5filter.
(Reading database ...
dpkg: warning: files list file for package 'mysql-client-5.5' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-server-core-5.5' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'apache2.2-bin' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'php5-cli' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'apache2.2-common' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-server-5.5' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'apache2-utils' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libmysqlclient18:i386' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libmysqlclient18:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'php5-common' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'apache2-mpm-prefork' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libdbd-mysql-perl' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libqt4-sql-mysql:i386' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libqt4-sql-mysql:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-common' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-client-core-5.5' missing; assuming package has no files currently installed
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 295367 files and directories currently installed.)
Unpacking libapache2-mod-php5filter (from .../libapache2-mod-php5filter_5.4.9-4ubuntu2.1_amd64.deb) ...
Setting up libapache2-mod-php5filter (5.4.9-4ubuntu2.1) ...
Error: The new file /usr/share/php5/php.ini-production does not exist!
dpkg: error processing libapache2-mod-php5filter (--configure):
subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of php5:
php5 depends on libapache2-mod-php5 (>= 5.4.9-4ubuntu2.1) | libapache2-mod-php5filter (>= 5.4.9-4ubuntu2.1) | php5-cgi (>= 5.4.9-4ubuntu2.1) | php5-fpm (>= 5.4.9-4ubuntu2.1); however:
Package libapache2-mod-php5 is not installed.
Package libapache2-mod-php5filter is not configured yet.
Package php5-cgi is not installed.
Package php5-fpm is not installed.
dpkg: error processing php5 (--configure):
dependency problems - leaving unconfigured
Setting up php5-mysql (5.4.9-4ubuntu2.1) ...No apport report written because MaxReports is reached already
Creating config file /etc/php5/mods-available/mysql.ini with new version
cp: cannot create regular file /etc/php5/mods-available/mysql.ini: No such file or directory
dpkg: error processing php5-mysql (--configure):
subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
Errors were encountered while processing:
libapache2-mod-php5filter
php5
php5-mysql
Error in function:
Setting up libapache2-mod-php5filter (5.4.9-4ubuntu2.1) ...
Error: The new file /usr/share/php5/php.ini-production does not exist!
dpkg: error processing libapache2-mod-php5filter (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of php5:
php5 depends on libapache2-mod-php5 (>= 5.4.9-4ubuntu2.1) | libapache2-mod-php5filter (>= 5.4.9-4ubuntu2.1) | php5-cgi (>= 5.4.9-4ubuntu2.1) | php5-fpm (>= 5.4.9-4ubuntu2.1); however:
Package libapache2-mod-php5 is not installed.
Package libapache2-mod-php5filter is not configured yet.
Package php5-cgi is not installed.
Package php5-fpm is not installed.
dpkg: error processing php5 (--configure):
dependency problems - leaving unconfigured
当我取消失败的窗口时,libapache2-mod-php5 的状态被标记为未安装!
我目前正在检查每个软件包,看看是否可以通过软件中心再次安装它们,以尝试消除此错误。有人知道我做了什么以及如何修复它吗?
更新
我现在已经检查了错误报告中提到的所有缺失的程序,并且它们都安装在了系统上!
simon@simon-VGN-AR71E:~$ sudo aptitude remove apache2 php5 mysql-server
The following packages will be REMOVED:
apache2 mysql-server php5
The following partially installed packages will be configured:
libapache2-mod-php5 php5-gd php5-mysql phpmyadmin
0 packages upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 168 kB will be freed.
Setting up libapache2-mod-php5 (5.4.9-4ubuntu2.1) ...
Error: The new file /usr/share/php5/php.ini-production does not exist!
dpkg: error processing libapache2-mod-php5 (--configure):
subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports has already been reached
Errors were encountered while processing:
libapache2-mod-php5
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Setting up php5-gd (5.4.9-4ubuntu2.1) ...
Creating config file /etc/php5/mods-available/gd.ini with new version
cp: cannot create regular file ‘/etc/php5/mods-available/gd.ini’: No such file or directory
dpkg: error processing php5-gd (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of phpmyadmin:
phpmyadmin depends on php5-mysql | php5-mysqli | php5-mysqlnd; however:
Package php5-mysql is not configured yet.
Package php5-mysqli is not installed.
Package php5-mysqlnd is not installed.
dpkg: error processing phpmyadmin (--configure):
dependency problems - leaving unconfigured
Setting up libapache2-mod-php5 (5.4.9-4ubuntu2.1) ...
Error: The new file /usr/share/php5/php.ini-production does not exist!
dpkg: error processing libapache2-mod-php5 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of php5:
php5 depends on libapache2-mod-php5 (>= 5.4.9-4ubuntu2.1) | libapache2-mod-php5filter (>= 5.4.9-4ubuntu2.1) | php5-cgi (>= 5.4.9-4ubuntu2.1) | php5-fpm (>= 5.4.9-4ubuntu2.1); however:
Package libapache2-mod-php5 is not configured yet.
Package libapache2-mod-php5filter is not installed.
Package php5-cgi is not installed.
Package php5-fpm is not installed.
dpkg: error processing php5 (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
php5-gd
phpmyadmin
libapache2-mod-php5
php5
好的,我只剩下两个试图删除的包,php5-common 和 php5-cli。php-cli 拒绝删除,而 php5-common 抛出以下错误:
答案1
好的,以防万一有人遇到相同或类似的问题,我已经修复了它:)
经过漫长的努力,我从软件中心删除了每个模块,直到找到两个软件包:php5-common 和 php5-cli,这两个软件包拒绝承认我的强大功能,并坚持安装,我转向终端并输入
sudo apt-get remove --purge php5-common php5-cli
失败原因:
dpkg: error processing php5-mysql (--purge):
subprocess installed pre-removal script returned error exit status 127
Removing php-gettext ...
Removing php5-mcrypt ...
Purging configuration files for php5-mcrypt ...
Removing php5-cli ...
Removing php5-common ...
Purging configuration files for php5-common ...
Errors were encountered while processing:
php5-gd
php5-mysql
我回到软件中心并搜索php5-通用 php5-cli它购买了最后两个要删除的软件包并单击了 php5-common 旁边的卸载,然后它就带走了 php5-cli...好极了!