我正在尝试安装 apache httpd,但失败了
root@web [/]# yum install httpd
Loaded plugins: downloadonly, fastestmirror, replace
Loading mirror speeds from cached hostfile
* epel: mirror.compevo.com
* remi-php56: mirror.pw
* remi-test: mirror.pw
* List item
Setting up Install Process
No package httpd available.
Error: Nothing to do
编辑:这是 repolist
root@web [/]# yum repolist
Loaded plugins: downloadonly, fastestmirror, replace
Loading mirror speeds from cached hostfile
epel/metalink | 16 kB 00:00
* epel: mirror.compevo.com
* remi-php56: mirror.pw
* remi-test: mirror.pw
remi-debuginfo | 2.9 kB 00:00
remi-php55-debuginfo | 2.9 kB 00:00
remi-php56 | 2.9 kB 00:00
remi-php56-debuginfo | 2.9 kB 00:00
remi-test | 2.9 kB 00:00
remi-test-debuginfo | 2.9 kB 00:00
repo id repo name status
epel Extra Packages for Enterprise Linux 6 - x86_64 10,217+881
remi-debuginfo Les RPM de remi pour Enterprise Linux 6 - x86_64 - debugin 31+550
remi-php55-debuginfo Les RPM de remi de PHP 5.5 pour Enterprise Linux 6 - x86_6 0+207
remi-php56 Les RPM de remi de PHP 5.6 pour Enterprise Linux 6 - x86_6 6+316
remi-php56-debuginfo Les RPM de remi de PHP 5.6 pour Enterprise Linux 6 - x86_6 0+215
remi-test Les RPM de remi en test pour Enterprise Linux 6 - x86_64 29+66
remi-test-debuginfo Les RPM de remi en test pour Enterprise Linux 6 - x86_64 - 4+16
repolist: 10,287
root@web [/]# cat /etc/yum.repos.d/CentOS-Base.repo
cat: /etc/yum.repos.d/CentOS-Base.repo: No such file or directory
root@web [/]#
我使用了链接http://www.if-not-true-then-false.com/2010/install-apache-php-on-fedora-centos-red-hat-rhel/安装
我下载了 centos-release-6-5 并使用 rpm -ivh 安装。结果如下
root@web [/]# rpm -ivh http://anorien.csc.warwick.ac.uk/mirrors/centos/6.5/os/x86_64/Packages/centos-release-6-5.el6.centos.11.1.x86_64.rpm
Retrieving anorien.csc.warwick.ac.uk/mirrors/centos/6.5/os/x86_64/Packages/centos-release-6-5.el6.centos.11.1.x86_64.rpm
Preparing... ########################################### [100%]
package centos-release-6-5.el6.centos.11.2.x86_64 (which is newer than centos-release-6-5.el6.centos.11.1.x86_64) is already installed
file /etc/yum.repos.d/CentOS-Vault.repo from install of centos-release-6-5.el6.centos.11.1.x86_64 conflicts with file from package centos-release-6-5.el6.centos.11.2.x86_64
我尝试使用 -Uvh,结果相同
root@web [/]# rpm -Uvh centos-release-6-5.el6.centos.11.1.x86_64.rpm
Preparing... ########################################### [100%]
package centos-release-6-5.el6.centos.11.2.x86_64 (which is newer than centos-release-6-5.el6.centos.11.1.x86_64) is already installed
root@web [/]#
答案1
我不知道是怎么回事,但有人设法删除了你的base
和updates
repos,这给了你操作系统本身。你剩下的只是一堆扩展的 repos,它们提供了某些工具的更新版本。这是行不通的。
拥有您需要的 repo 文件的包名为centos-release-6-5
,您最好从其中一个镜像中获取它。这是一个小文件,所以哪一个并不重要。尝试下载http://anorien.csc.warwick.ac.uk/mirrors/centos/6.5/os/x86_64/Packages/centos-release-6-5.el6.centos.11.1.x86_64.rpm并使用 进行安装rpm -Uvh --oldpackage
;这应该会为您提供基础和更新存储库,之后安装httpd
和执行常规操作都updates
应该会更好地工作。
如果您是这里的常客,请学会使用我们的标记系统。它非常简单。