[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Use of dpkg --set-selections is brain-dead?



Hello gurus,

I thought I would be slick and write a package that contains a script that will figure out what should be installed/removed/upgraded/etc. on each of the machines where I work. (Using sarge, btw.) I had planned to do this by listing each of the packages and it's install status in a file, then piping that file to 'dpkg --set-selections', and then using 'apt-get dselect-upgrade' to process the new package selections.

Unfortunately, this doesn't seem to work as I expected.

I've traced my problem down to the use of 'dpkg --set-selections' command. As an example, I have a package named tiem-nis-client-cfg that sets up NIS for generic workstations. If I understand correctly, I should be able to do the following:

   echo "tiem-nis-client-cfg      install" | dpkg --set-selections

And then, when I type 'dpkg --get-selections', I should see "tiem-nis-client-cfg install" one some line in the output. Unfortunately, this doesn't seem to work:

~# echo "tiem-nis-client-cfg install" | dpkg --set-selections ; echo $? ; dpkg --get-selections | grep 'tiem-nis-client-cfg' ; echo $?
   0
   1

The dpkg --set-selections command prints no error, and returns no error code, but tiem-nis-client-cfg isn't set for installation.

I know that the package database knows about my tiem-nis-client-cfg, because I can do this:

   ~# apt-cache show tiem-nis-client-cfg
   Package: tiem-nis-client-cfg
   ...blah, blah, blah...

And I can install the package by hand:

   ~# apt-get install tiem-nis-client-cfg
   Reading Package Lists... Done
   Building Dependency Tree... Done
   The following extra packages will be installed:
     libslp1 nis
   Suggested packages:
     slpd openslp-doc
   The following NEW packages will be installed:
     libslp1 nis tiem-nis-client-cfg
   0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
   Need to get 291kB of archives.
   After unpacking 1065kB of additional disk space will be used.
   Do you want to continue? [Y/n]
   Get:1 http://ftp.us.debian.org sarge/main libslp1 1.0.11a-2 [47.3kB]
   Get:2 http://tortoise sarge/non-free tiem-nis-client-cfg 1.4 [3780B]
Get:3 http://ftp.us.debian.org sarge/main nis 3.13-2 [240kB] Fetched 291kB in 0s (293kB/s)
   Preconfiguring packages ...
   Selecting previously deselected package libslp1.
   (Reading database ... 50195 files and directories currently installed.)
   Unpacking libslp1 (from .../libslp1_1.0.11a-2_i386.deb) ...
   Selecting previously deselected package nis.
   Unpacking nis (from .../archives/nis_3.13-2_i386.deb) ...
   Setting up libslp1 (1.0.11a-2) ...
Setting up nis (3.13-2) ...
   Setting NIS domainname to: tiem.utk.edu
Starting NIS services: ypbind [binding to YP server .......... backgrounded] (Reading database ... 50289 files and directories currently installed.) Unpacking tiem-nis-client-cfg (from .../tiem-nis-client-cfg_1.4_all.deb) ...
   Setting up tiem-nis-client-cfg (1.4) ...
   Setting NIS domainname to: tiem
   Starting NIS services: ypbind


Tell me, oh wise gurus of Debian -- is dpkg just brain-dead? Is the man page horribly wrong/out-of-date? Or what?

Confused,

Michael Peek



Reply to: