PDA

View Full Version : [Solved] File input to apt-get install



nbday
August 30th, 2014, 05:38 PM
I'd like to pipe a text file containing the names of packages to install to the apt-get command. I've read man apt-get and don't see any obvious help there. "apt-get install < file.txt" doesn't work.

sbnwl
August 30th, 2014, 05:57 PM
Could this work for you

sudo apt-get -s install $(cat file.txt)

The 'bash' is sometimes useful in this regard!

nbday
August 30th, 2014, 07:08 PM
Thanks! "sudo apt-get install -y $(cat file.txt)" works perfectly.