无法安装特定版本的 apache2

无法安装特定版本的 apache2

我对此很陌生,我的发行版是 Ubuntu 14.04,我已经安装了 apache2 最新版本,它可以在存储库中使用(即 2.4.7-1ubuntu4.9)。

我使用过这个命令,apt-get install lamp-server^但出现了依赖性错误

The following packages have unmet dependencies: apache2-mpm-prefork : Depends: apache2 (= 2.4.7-1ubuntu4.1) but 2.4.7-1ubuntu4.9 is to be installed

因此,我尝试安装 2.4.7-1ubuntu4.1 版本的 apache2,但是当我运行此命令时:

apt-get install apache2=2.4.7-1ubuntu4.1

我得到这个输出:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  apache2
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.`

Output of :`apt show apache2-mpm-prefork -a`

`Package: apache2-mpm-prefork
Priority: optional
Section: net
Installed-Size: 22.5 kB
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Debian Apache Maintainers <[email protected]>
Source: apache2
Version: 2.4.7-1ubuntu4.1
Provides: httpd, httpd-cgi
Depends: apache2 (= 2.4.7-1ubuntu4.1)
Download-Size: 1,460 B
Origin: Ubuntu
Supported: 5y
Task: lamp-server, mythbuntu-frontend, mythbuntu-desktop, mythbuntu-backend-slave, mythbuntu-backend-master, mythbuntu-backend-master
Description: transitional prefork MPM package for apache2
 This is a transitional package to apache2 for users of apache2-mpm-prefork and
 can be safely removed after the installation is complete.

Package: apache2-mpm-prefork
Priority: optional
Section: net
Installed-Size: 22.5 kB
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Debian Apache Maintainers <[email protected]>
Source: apache2
Version: 2.4.7-1ubuntu4
Provides: httpd, httpd-cgi
Depends: apache2 (= 2.4.7-1ubuntu4)
Download-Size: 1,462 B
Origin: Ubuntu
Supported: 5y
Task: lamp-server, mythbuntu-frontend, mythbuntu-desktop, mythbuntu-backend-slave, mythbuntu-backend-master, mythbuntu-backend-master
Description: transitional prefork MPM package for apache2
 This is a transitional package to apache2 for users of apache2-mpm-prefork and
 can be safely removed after the installation is complete.`

所以,我无法安装该特定版本的 apache2。

答案1

依赖关系存在一些似乎无法解决的错误,有一种不同的方法可行,

sudo apt-get install tasksel,tasksel 是一个软件包组实用程序,它将在安装时安装几个分组的软件包以免出现任何错误,并且它会自动配置某些默认值,以便分组的软件包能够很好地集成。

要获取所有包分组任务,请执行此命令,tasksel --list-tasks

它将列出所有可用的任务,使用此包可以轻松安装某些标准分组包(称为任务),例如 kubuntu-active,kubuntu-desktop,xubuntu-live ..... 和许多其他。

因此,首先使用此命令安装基本服务器,tasksel install server然后使用此命令删除所有 lamp 包tasksel remove lamp-server

,现在您已经拥有服务器安装所需的所有文件,因为软件包只是暂时删除,请使用 autoremove 完全删除 lamp 软件包,使用此命令sudo apt-get autoremove,,

然后使用tasksel安装lamp-server,使用以下命令:tasksel install lamp-server,这样您就完成了安装。

警告:据我所知,此包“tasksel”仅适用于 Ubuntu

相关内容