1

Tip #825   Install a large number of packages with aptitude

Sometimes you need to install a large amount of packages on a fresh installed system. Of course, you can install each of them manually or let a script do that but there is a much more comfortable way.

You need a file containing all packages you want to install - one package per line.

cat packages | xargs aptitude install

You can also perform this action with multiple files. This is needed when there are packages that need to be installed before other ones are installable.

for FILE in to_install/*; do
    echo Installing from $FILE
    cat $FILE | xargs aptitude install
done

You can prepend a number to the file names to ensure the installation order goes right.