2

I want to install packages automatically by running a script

I can write

 yum install php

but I want it to install another package once installation of the php package is completed

Is there any solution to make it automatic?

I have around 20packages which are to be downloaded from remi repository

1
  • You mean yum doesn't accept yum install <package> <package> <package>?
    – mkaito
    Aug 27, 2012 at 13:04

1 Answer 1

3

Write your script named installer.sh as:

#!/bin/bash
yum -y install php
yum -y install <another_package>
yum -y install <yet_another_package>
...

Then run it $ bash installer.sh

2
  • it wont be done automatic, because it will prompt for Yes/No and user has to type in Y inorder to continue, Is there a way to do it automatic without need of user
    – meWantToLearn
    Aug 27, 2012 at 6:51
  • @meWantToLearn in that case use -y option, see the updated answer
    – Rohan
    Aug 27, 2012 at 6:57

You must log in to answer this question.