Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
01-21-2010, 12:25 AM
|
#1
|
|
Member
Registered: May 2008
Posts: 39
Rep:
|
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 ????
|
|
|
|
01-21-2010, 12:51 AM
|
#2
|
|
Member
Registered: Aug 2007
Location: Vietnam
Distribution: RedHat based, Debian based, Slackware, Gentoo
Posts: 724
Rep:
|
Change to "yum -y install $package".
|
|
|
|
01-21-2010, 01:45 AM
|
#3
|
|
Member
Registered: May 2008
Posts: 39
Original Poster
Rep:
|
Quote:
Originally Posted by quanta
Change to "yum -y install $package".
|
Thanks for you help.
I did that, as per your instruction by default iam giving yes to all the packages, suppose if i want to get the input from the user whether to install it or not (yes or no), what i have to do ??
|
|
|
|
01-21-2010, 06:29 PM
|
#4
|
|
Guru
Registered: Aug 2004
Location: Brisbane
Distribution: Centos 6.4, Centos 5.9
Posts: 15,021
|
man read
|
|
|
|
01-22-2010, 01:56 AM
|
#5
|
|
Member
Registered: Jan 2010
Distribution: Arch, Gentoo, FreeBSD
Posts: 64
Rep:
|
You might try passing the entire list contents to a widget that allows the user to modify it, then pass the modified list to yum.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 01:16 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|