0

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 [/]#
MadHatter
  • 78,442
  • 20
  • 178
  • 229
  • 4
    What has happened to your `base` repository? Why is it disabled or missing? Could you **edit into your question** the outputs of `yum repolist` and `cat /etc/yum.repos.d/CentOS-Base.repo`? – MadHatter Oct 07 '14 at 12:23
  • MadHatter is right... you are missing all the CentOS related repos – Mike Oct 07 '14 at 12:42
  • See [my comment](http://serverfault.com/questions/634136/centos-6-5-x86-64-fails-to-install-httpd-using-yum#comment763315_634153) below. – Michael Hampton Oct 07 '14 at 13:51
  • Yes Michael Hampton, I used your format rpm -Uvh --oldpackage . Failed to retrieve base and updates repos back – Rejeesh Rajan Oct 07 '14 at 13:57

1 Answers1

2

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.

MadHatter
  • 78,442
  • 20
  • 178
  • 229
  • **Please, edit this into your question, and make sure you get the formatting right.** It's unreadable, otherwise. But if thie issue is `rpm` refusing to install because some of the files from the old package are still around, add ``--force`` to the `rpm` command. You **need** those `base` and `updates` repos back. – MadHatter Oct 07 '14 at 13:19
  • You need to use `rpm -Uvh --oldpackage` in this scenario, _not_ `rpm -ivh`. – Michael Hampton Oct 07 '14 at 13:34
  • D'oh! You are, of course, completely right, and I've amended accordingly. Thanks! – MadHatter Oct 07 '14 at 16:46