问题。

问题。

我之前已经安装了 php 和 apache2 服务器,但却因错误而陷入困境。

到目前为止的流程如下:

sudo apt-get install tasknet
sudo apt-get install lamp-server

在安装过程中,tasksel 停止并显示

tasksel: aptitude failed (100)

我试过:

sudo tasksel remove lamp-server
sudo apt-get install lamp-server

出现同样的错误

接下来我尝试

sudo apt-get update && sudo apt-get upgrade

结果如下:

Setting up mysql-server-5.5 (5.5.31-0ubuntu0.13.04.1) ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up php5-common (5.4.9-4ubuntu2.1) ...
Not replacing deleted config file /etc/php5/mods-available/pdo.ini
ERROR: /etc/php5/mods-available/pdo.ini does not exist
dpkg: error processing php5-common (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of php5-cli:
 php5-cli depends on php5-common (= 5.4.9-4ubuntu2.1); however:
  Package php5-common is not configured yet.

dpkg: error processing php5-cli (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libapache2-mod-php5:
 libapache2-mod-php5 depends on php5-common (= 5.4.9-4ubuntu2.1); however:
  Package php5-common is not configured yet.

dpkg: error processing libapache2-mod-php5 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of php5-mysql:
 php5-mysql depends on phpapi-20100525; however:
  Package phpapi-20100525 is not installed.
  Package libapache2-mod-php5filter which provides phpapi-20100525 is not installed.
  Package libapache2-mod-php5 which provides phpapi-20100525 is not configured yet.
  Package php5-cli which provides phpapi-20100525 is not configured yet.
 php5-mysql depends on php5-common (= 5.4.9-4ubuntuNo apport report written because the error message indicates it's a follow-up error from a previous failure.
No apport report written because MaxReports has already been reached
No apport report written because MaxReports has already been reached
No apport report written because MaxReports has already been reached
2.1); however:
  Package php5-common is not configured yet.

dpkg: error processing php5-mysql (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.5; however:
  Package mysql-server-5.5 is not configured yet.

dpkg: error processing mysql-server (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mysql-server-5.5
 php5-common
 php5-cli
 libapache2-mod-php5
 php5-mysql
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

所以我尝试了:

sudo dpkg --configure -a

并得到以下结果:

Setting up php5-common (5.4.9-4ubuntu2.1) ...
Not replacing deleted config file /etc/php5/mods-available/pdo.ini
ERROR: /etc/php5/mods-available/pdo.ini does not exist
dpkg: error processing php5-common (--configure):
 subprocess installed post-installation script returned error exit status 2
Setting up mysql-server-5.5 (5.5.31-0ubuntu0.13.04.1) ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of php5-cli:
 php5-cli depends on php5-common (= 5.4.9-4ubuntu2.1); however:
  Package php5-common is not configured yet.

dpkg: error processing php5-cli (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libapache2-mod-php5:
 libapache2-mod-php5 depends on php5-common (= 5.4.9-4ubuntu2.1); however:
  Package php5-common is not configured yet.

dpkg: error processing libapache2-mod-php5 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.5; however:
  Package mysql-server-5.5 is not configured yet.

dpkg: error processing mysql-server (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of php5-mysql:
 php5-mysql depends on phpapi-20100525; however:
  Package phpapi-20100525 is not installed.
  Package libapache2-mod-php5filter which provides phpapi-20100525 is not installed.
  Package libapache2-mod-php5 which provides phpapi-20100525 is not configured yet.
  Package php5-cli which provides phpapi-20100525 is not configured yet.
 php5-mysql depends on php5-common (= 5.4.9-4ubuntu2.1); however:
  Package php5-common is not configured yet.

dpkg: error processing php5-mysql (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 php5-common
 mysql-server-5.5
 php5-cli
 libapache2-mod-php5
 mysql-server
 php5-mysql

查看完这些错误后,我尝试再次手动安装 mySQL 服务器

sudo apt-get install mysql-server-5.5

但得到的错误与我收到的最后一组错误相同。

我跑了

 sudo tasksel --test

结果如下:

debconf-apt-progress -- apt-get -q -y install lamp-server^

所以我运行了这个命令sudo,在 15% 的时候它说安装 mysql-server,然后在 mysql-com 上安装,在 18% 的时候它停止了。

运行了一些我已经尝试过的命令,得到了相同的结果。

问题。

请问您能建议我下一步该怎么做吗?

更新

我进入sudo apt-get update && sudo apt-get upgrade并下载并检查了软件包后给出了以下报告:

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
6 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
Setting up mysql-server-5.5 (5.5.31-0ubuntu0.13.04.1) ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.

等等等等等等

答案1

我建议人们不要使用 lamp-server 和 taskel,而是以正常方式安装 apache 和 mysql,这也是它们通常在服务器上的设置方式。

sudo apt-get install apache2 php5 libapache2-mod-php5 mysql-server php5-mysql
sudo service apache2 restart

这与已安装的其他软件包数量兼容。例如,你可以这样做

sudo apt-get install phpmyadmin

并浏览http://localhost/phpmyadmin/

答案2

我曾经做过:

$ sudo tasksel install lamp-server

而不是使用apt-get- 这对我来说总是有效的。但是,我建议按照 Capt.Nemo 的说明进行安装。

相关内容