Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do you install Debian/Ubuntu packages from a file containing a list of package names?

I have a file packages.txt like:

apache2                       install
libapache2-mod-wsgi                       install
python-setuptools                       install
python-psycopg2                       install
python-numpy                       install
postgresql-plpython-9.1                       install
postgresql-client-common                       install
postgresql-client-9.1                       install
python-dev                       install
build-essential                       install
libtidy-0.99                       install
xvfb                       install
firefox                       install

And then I run:

sudo apt-get install dselect --yes
sudo dpkg --set-selections < "packages.txt"
sudo apt-get dselect-upgrade -y

But this doesn't seem to install everything. What am I doing wrong?

share|improve this question
up vote 1 down vote accepted

if you can paste the output of;

cut -f1 -d' ' packages.txt | xargs dpkg -l

that would help to show which packages didn't get installed. (that might run into an args count limit if you packages.txt is bonkers long, but try it and see)

then you can try to install (apt-get install somepackage) the packages that were missed to see any useful debugging information.

share|improve this answer
Yeah, libtidy-0.99 had its name changed to libtidy-0.99-0 in Ubuntu 12.04 (whereas I had previously been using 11.10), and that apparently prevented dpkg from installing the two packages after it. Not sure why I didn't get any error messages... – Cerin May 28 '12 at 2:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.