yum install offline/without package on Centos 6 from a source due to firewall
Solution 1
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).
Solution 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.
Related videos on Youtube
Selay
Updated on September 18, 2022Comments
-
Selay over 1 year
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.
-
lsd over 7 yearsYes, 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.