Linux – CENTOS 6.5 x86_64 fails to install httpd using yum

apache-2.2centos6.5linux

I am trying to install apache httpd but it fails

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

Edit: Here is the 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 [/]#

I used the link http://www.if-not-true-then-false.com/2010/install-apache-php-on-fedora-centos-red-hat-rhel/ to install

I downloaded centos-release-6-5 and installed using rpm -ivh . The result is as below

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

I tried using -Uvh and the result is same

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 [/]#

Best Answer

I have no idea how, but someone has managed to delete your base and updates repos, which gives you the operating system itself. All you're left with is a bunch of extended repos that provide more up-to-date versions of certain tools. That isn't going to work.

The package that owns the repo file you need is called centos-release-6-5, and your best bet is to get it from one of the mirrors. It's a small file, so it doesn't much mater which one. Try downloading 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 and installing it with rpm -Uvh --oldpackage; that should give you the base and updates repos back, and after that both installing httpd and doing general updates should work much better.

And please, if you're going to be a regular here, learn to use our markup system. It's pretty simple.