Find the answer to your Linux question:
Results 1 to 4 of 4
Hi friends, I want to install a list of packages in the file. i tried using yum install in a shell script, while read -r line do echo "Package-->$line" yum ...
  1. #1
    Just Joined!
    Join Date
    Oct 2008
    Posts
    30

    Lightbulb Shell script to install list of packages in a file

    Hi friends,
    I want to install a list of packages in the file.
    i tried using yum install in a shell script,
    while read -r line
    do
    echo "Package-->$line"
    yum install $line
    done < file1.txt

    if i run this script:

    Loaded plugins: refresh-packagekit
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package gphpedit.i586 0:0.9.95-0.1.20090209snap.fc11 set to be updated
    --> Finished Dependency Resolution

    Dependencies Resolved

    ================================================== ================================================== ================================================== =======
    Package Arch Version Repository Size
    ================================================== ================================================== ================================================== =======
    Installing:
    gphpedit i586 0.9.95-0.1.20090209snap.fc11 updates 453 k

    Transaction Summary
    ================================================== ================================================== ================================================== =======
    Install 1 Package(s)
    Upgrade 0 Package(s)

    Total download size: 453 k
    Is this ok [y/N]: Is this ok [y/N]: Is this ok [y/N]: Is this ok [y/N]: Is this ok [y/N]: Is this ok [y/N]: Is this ok [y/N]: Is this ok [y/N]: Exiting on user Command
    Complete!

    Does anyone know how to solve this problem

  2. #2
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568
    Try using
    yum -y install
    So that it won't prompt for conformation
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

  3. #3
    Just Joined!
    Join Date
    Oct 2008
    Posts
    30

    Lightbulb

    Thanks for you help
    Suppose if i want to get the input from the user that whether to install it or not (yes / no), what have to be done ??

  4. #4
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568
    oops!! sorry i don't know how to do that..hope some LF member might answer your question.
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...