apt-get 12.04.5 损坏

apt-get 12.04.5 损坏

当我尝试将 php 更新到 5.4 时,我似乎破坏了 apt-get!我现在尝试的所有方法都会给出以下结果

You might want to run 'apt-get -f install' to correct these:
    The following packages have unmet dependencies.
     libapache2-mod-php5 : Depends: apache2-mpm-prefork (> 2.0.52) but it is not going to be installed or
                                    apache2-mpm-itk but it is not going to be installed
                           Depends: apache2.2-common but it is not going to be installed
    E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

跑步apt-get -f install会给我

Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  apache2-mpm-prefork apache2.2-common
Suggested packages:
  apache2-doc apache2-suexec apache2-suexec-custom
The following NEW packages will be installed
  apache2-mpm-prefork apache2.2-common
0 to upgrade, 2 to newly install, 0 to remove and 278 not to upgrade.
3 not fully installed or removed.
Need to get 0 B/229 kB of archives.
After this operation, 876 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
(Reading database ... 152370 files and directories currently installed.)
Unpacking apache2.2-common (from .../apache2.2-common_2.2.22-1ubuntu1.10_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/apache2.2-common_2.2.22-1ubuntu1.10_amd64.deb (--unpack):
 trying to overwrite '/usr/share/man/man8/apache2.8.gz', which is also in package apache2-bin 2.4.16-4+deb.sury.org~precise+4
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Unpacking apache2-mpm-prefork (from .../apache2-mpm-prefork_2.2.22-1ubuntu1.10_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/apache2-mpm-prefork_2.2.22-1ubuntu1.10_amd64.deb (--unpack):
 trying to overwrite '/usr/sbin/apache2', which is also in package apache2-bin 2.4.16-4+deb.sury.org~precise+4
Processing triggers for man-db ...
Errors were encountered while processing:
 /var/cache/apt/archives/apache2.2-common_2.2.22-1ubuntu1.10_amd64.deb
 /var/cache/apt/archives/apache2-mpm-prefork_2.2.22-1ubuntu1.10_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我尝试过的方法似乎都无法解决这个问题。有人可以帮忙吗?

谢谢

答案1

您需要升级内核

首先修复当前软件包

sudo dpkg --configure -a

然后运行更新和升级

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

安装更新后(有些可能不会,因为新软件包在新内核中)

sudo apt-get dist-upgrade

您可能需要重新启动

相关内容