How to make linux dowload dependencies mentioned in the requires tag in rpm spec

HI,
I have created an rpm spec file which has two require tags like :

Requires: maven >= 3.0.5
Requires: java >= 1:1.8

Open in new window

Although if any of maven or java is of lesser version the installation fails.
But how can i make it automatically download or upgrade also ?

Thanks
Rohit BajajAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Daniel McAllisterPresident, IT4SOHO, LLCCommented:
The YUM tool will do this automatically.

Dan
IT4SOHO
0
Rohit BajajAuthor Commented:
so just mentioning the require field in spec file is enough ?
0
Daniel McAllisterPresident, IT4SOHO, LLCCommented:
Yes -- and your RPM doesn't even have to be in a repository -- you can tell YUM to install the RPM from the local disk, and when it sees the dependencies, it will try to satisfy them using the repositories that it has configured.

Of course, you have to have the package names specified properly, and they have to exist in a configured repository -- but that only makes sense.

Dan
IT4SOHO
0
Rohit BajajAuthor Commented:
so yum will automatically look for the dependencies in its configured repositories and if it finds,
It will either update it or install it.
Also one more thing i want to know is , how to see what rpms are in the yum repositories so as to specify the correct name in the require fields.
0
Daniel McAllisterPresident, IT4SOHO, LLCCommented:
yum repositories are located in /etc/yum.repos.d (all files that end in .repo are scanned for entries that say "enabled=1" -- NOTE: Each file CAN contain more than 1 repo definitiion.

listing available packages is directly via yum:
   yum list

Dan
IT4SOHO
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.