Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have two CentOS machines, one 6.3 box (A), and another CentOS 6.1. (B)

6.3 box is with internet connection, 6.1 box is without internet connection.

I want to download ALL dependencies of a product on Box A, then copy those n Box B, and install the product.

I tried with

yum --downloadonly --downloaddir=*~/downloadrepo* -y install *product*`
cd *~/downloadrepo*
createrepo .

Then I disabled all repos (with --disablerepo), except my repo, and installed product on the same machine (Box A). No errors.

  • yum install *product*

Now when I copied this repo to Box B, and tried to install with same command, it starts installing, but then gives lot of errors like below:

Error: Missing Dependency: libldap-2.3.so.0()(64bit) is needed by package php-ldap-5.1.6-27.el5_5.3.x86_64 (installed)

As there any way I can achieve what I need?

UPDATE

By the time I started working with option suggested by @rkosegi (--releasever=version), I was given a new box with same version CentOS 6.1 (C)

I tried above mentioned commands on Box C, and copied repo it to Box B. Still it failed. The reason: though both boxes are 6.1, those are not identical (uname -r returns different strings).

Yum does not download dependencies, if those are already installed. So my repo did not contain some of the dependencies (including OpenJDK). So, when I try to install on Box B, it fails.

Quite frustrating!!!

But then I found command 'repotrack' here.

cd ~/downloadrepo
repotrack -p . -a x86_64 product
createrepo .

I got a lot more files than with yum, hopefully it will do the trick.

I'll update, once I try install.

UPDATE

Command repotrack did not work for me. When I tried to install from repository created with 'repotrack', got following errors:

Error: Package: perl-CGI-3.51-127.el6.x86_64 (repo-local)
       Requires: perl = 4:5.10.1-127.el6
       Installed: 4:perl-5.10.1-119.el6_1.1.x86_64 (@anaconda-CentOS-201112102333.x86_64/6.2)
           perl = 4:5.10.1-119.el6_1.1
Error: Package: audit-libs-python-2.2-2.el6.x86_64 (repo-local)
       Requires: audit-libs = 2.2-2.el6
       Installed: audit-libs-2.1.3-3.el6.x86_64 (@anaconda-CentOS-201112102333.x86_64/6.2)
           audit-libs = 2.1.3-3.el6

I tried removing these two files from folder, and rebuilding repository with 'createrepo'. It gave another set of errors.

Not sure what options I have at the moment...

share|improve this question
    
There is no "6.1" CentOS. it is just CentOS 6 up to date to the moment when RHEL 6.1 was cut, probably with a lot of updates since. –  vonbrand Mar 5 '13 at 23:17
add comment

3 Answers

If you have to do this a lot, you might want to take the time to set up Spacewalk. It will automate creating the repository and populating it with the appropriate packages (or, if you want, all of them). Not to mention everything else it does...

share|improve this answer
add comment
yum --downloadonly --downloaddir=~/downloadrepo -y install product

You need to instruct yum to download from repository of same version as target machine(6.1)

Also make you need to make sure, that machine(6.3) which will perform download don't have already installed some of dependencies which are missing on target machine (6.1)

share|improve this answer
    
That won't necesarily work, as it will get the packages needed to install on that system. That could very well be a very different set than the one required on a (probably outdated) not-networked machine. –  vonbrand Mar 5 '13 at 23:19
add comment

If you can't get a "clean" machine you either have to search manually for the missing parts with yum provides or

you have to go through your rpms that are already in you repo and query their dependencies: rpm -qp --requires RPM. If that list turns up something new not already part of your repo, you have to add it.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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