0

I want to "yum install php-mbstring" on Centos 6. The problem is that due to firewall restrictions, the centos machine can not connect outside. Therefore, epel etc packages fail due to unreachable: http://download.fedoraproject.org/pub/epel...

I can transfer any file from my computer to the centos machine. So, is it possible to download php-mbstring source and put to the centos machine so that it can be installed offline?

Note: Downloaded packages such as epel-release-6-8.noarch.rpm and putting on the centos machine doesnt work because they still need external connection when I run yum install.

  • Quite often when no direct internet access is allowed a proxy server is made available instead which yum can be configured to use – HBruijn Sep 6 '16 at 5:14
2

Use yumdownloader on a system which does have internet access.

This will pull the package and its dependencies (using the --resolve switch) down to the local directory.

Copy the files to the system in question and yum install using the path to the files.

2

You need to download your package (which will be called php-mbstring-….rpm) from the EPEL repository (for EL6, you can browse https://dl.fedoraproject.org/pub/epel/6/ to find the packages). Transfer that package to the server on which you need it installed, and run:

yum install php-mbstring-….rpm

In other words, if you give yum an rpm filename, rather than a simple package name, it will install that rpm without looking for the package in its repositories.

Note - if the package has requirements that would need to be satisfied by other packages, yum will still look in its repos as usual for those unsatisfied requirements. In that case, you can download all the dependencies in the same manner, then give all of them on the command line:

yum install /path/to/package1.rpm /path/to/package2.rpm /path/to/package3.rpm ...

(If you put them all in the same directory, you can obviously use a wildcard to avoid typing all the filenames).

  • 1
    Yes, and in that case you would have to download all the dependencies to local, and specify them all on the command line along with the original package. – lsd Sep 6 '16 at 0:56
  • 1
    No, you need to download the actual php-mbstring package - which you can find by browsing dl.fedoraproject.org/pub/epel/6 - and then do yum install …/php-mbstring-….rpm The /path/to/ part should be replaced by the actual path to the rpm file. – J Earls Sep 6 '16 at 1:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.