apt-get 损坏的软件包 lamp stack

apt-get 损坏的软件包 lamp stack

使用 Ubuntu 13.04,由于软件包损坏,我无法安装 LAMP 堆栈的任何部分。我试过

sudo apt-get -f install php5
sudo apt-get --purge remove php5 
sudo apt-get autoremove 

并尝试安装按顺序排列的所有依赖项

sudo apt-get --fix-broken --ignore-hold install php5
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php5 : Depends: libapache2-mod-php5 (>= 5.4.9-4ubuntu2) but it is not going to be installed or
             libapache2-mod-php5filter (>= 5.4.9-4ubuntu2) but it is not going to be installed or
             php5-cgi (>= 5.4.9-4ubuntu2) but it is not going to be installed or
             php5-fpm (>= 5.4.9-4ubuntu2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

希望得到一些见解,我认为这与发行版升级有关

编辑:更多 apt 输出

root@ascension:/home/kevin# dpkg --configure -a
root@ascension:/home/kevin# apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@ascension:/home/kevin# apt-get install php5
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php5 : Depends: libapache2-mod-php5 (>= 5.4.9-4ubuntu2) but it is not going to be     installed or
             libapache2-mod-php5filter (>= 5.4.9-4ubuntu2) but it is not going to be installed or
             php5-cgi (>= 5.4.9-4ubuntu2) but it is not going to be installed or
             php5-fpm (>= 5.4.9-4ubuntu2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
root@ascension:/home/kevin# apt-get remove php5-fpm
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'php5-fpm' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@ascension:/home/kevin# apt-get remove php5-cgi
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'php5-cgi' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@ascension:/home/kevin# apt-get remove libapache2-mod-php5filter
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'libapache2-mod-php5filter' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@ascension:/home/kevin# apt-get install apache2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
apache2 : Depends: apache2-mpm-worker (= 2.2.22-6ubuntu5) but it is not going to be     installed or
                apache2-mpm-prefork (= 2.2.22-6ubuntu5) but it is not going to be installed or
                apache2-mpm-event (= 2.2.22-6ubuntu5) but it is not going to be installed or
                apache2-mpm-itk (= 2.2.22-6ubuntu5) but it is not going to be installed
       Depends: apache2.2-common (= 2.2.22-6ubuntu5) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

编辑,来自@Braiam

apt-cache 输出:

php5:
Installed: (none)
Candidate: 5.4.9-4ubuntu2
Version table:
 5.4.9-4ubuntu2 0
    500 http://us.archive.ubuntu.com/ubuntu/ raring/main amd64 Packages
libapache2-mod-php5:
Installed: (none)
Candidate: 5.4.9-4ubuntu2
Version table:
 5.4.9-4ubuntu2 0
    500 http://us.archive.ubuntu.com/ubuntu/ raring/main amd64 Packages
php5-cgi:
Installed: (none)
Candidate: 5.4.9-4ubuntu2
Version table:
 5.4.9-4ubuntu2 0
    500 http://us.archive.ubuntu.com/ubuntu/ raring/main amd64 Packages
php5-fpm:
Installed: (none)
Candidate: 5.4.9-4ubuntu2
Version table:
 5.4.9-4ubuntu2 0
    500 http://us.archive.ubuntu.com/ubuntu/ raring/universe amd64 Packages

源列表的 cat & /etc/apt/sources.list.d/*.list

# deb cdrom:[Ubuntu 12.10 _Quantal Quetzal_ - Release amd64 (20121017.5)]/ .Trashes/501/dists/raring/main/binary-i386/

# deb cdrom:[Ubuntu 12.10 _Quantal Quetzal_ - Release amd64 (20121017.5)]/ .Trashes/501/dists/raring/restricted/binary-i386/
# deb cdrom:[Ubuntu 12.10 _Quantal Quetzal_ - Release amd64 (20121017.5)]/ quantal main restricted
# deb cdrom:[Ubuntu 12.10 _Quantal Quetzal_ - Release amd64 (20121017.5)]/.Trashes/501/ raring main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ raring main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ raring main restricted

## Major bug fix updates produced after the final release of the
## distribution.

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ raring universe
deb-src http://us.archive.ubuntu.com/ubuntu/ raring universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://us.archive.ubuntu.com/ubuntu/ raring multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ raring multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.


## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu quantal partner
# deb-src http://archive.canonical.com/ubuntu quantal partner

## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
# deb http://extras.ubuntu.com/ubuntu raring main
# deb-src http://extras.ubuntu.com/ubuntu raring main

#spotify yo
# deb http://repository.spotify.com stable non-free
deb http://us.archive.ubuntu.com/ubuntu/ raring-updates universe main restricted multiverse
deb http://security.ubuntu.com/ubuntu/ raring-security universe main restricted multiverse

如您所见,所有条目都很精彩,似乎没有其他问题。没什么新想法了。

答案1

安装php5:

sudo apt-get install php5

安装apache:

sudo apt-get install apache2

为了将 php5 与 apache2 一起使用,请安装:

sudo apt-get install libapache2-mod-php5

安装mysql客户端和服务端:

sudo apt-get install mysql-client mysql-server

就这样,您已经安装好了 LAMP 堆栈!

一行代码:

sudo apt-get install php5 apache2 libapache2-mod-php5 mysql-client mysql-server

相关内容