Search code examples
linuxcentosrpmcentos6yum

can't install httpd-devel rpm by using yum without internet access


I tried to install httpd-devel rpm package by using yum without internet access. I downloaded dependencies rpm packages by using --downloadonly option of yum on other coumptuer, and then I move rpm packages what I downlaoded to the machine what I want to install httpd_devel.

this is centos 6.8 release version.

I expect to install currently. but the machine showed error message bellow.

Running

yum install -y httpd-devel-2.2.15-69.el6.centos.x86_64.rpm 

gives this output:

Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Examining httpd-devel-2.2.15-69.el6.centos.x86_64.rpm: httpd-devel-2.2.15-69.el6.centos.x86_64
Marking httpd-devel-2.2.15-69.el6.centos.x86_64.rpm to be installed
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os&infra=stock error was
14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"
Error: Cannot find a valid baseurl for repo: base

Solution

  • yum tries to refresh its repositories which won't work without internet. I see two solutions:

    1) tell yum not to look at any of its configured repositories:

    yum --disablerepo="*" install -y httpd-devel-2.2.15-69.el6.centos.x86_64.rpm
    

    2) use rpm directly; don't use yum:

    rpm -Ivh httpd-devel-2.2.15-69.el6.centos.x86_64.rpm