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


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx



Relevant Pages

  • Errors applying kernel patch 118833-36
    ... install of Solaris 10 11/06. ... However, once the package list is done, I see a worrisome message: ... Below is the complete console output of the patch run. ... Changes for package SUNWnfsskr will not be applied to the system. ...
    (SunManagers)
  • Re: media player 10 setup issues
    ... Finished building install list. ... Package 'MPPRE' is version '10.0.0.3802'. ... Install for Exception pack ...
    (microsoft.public.windowsmedia)
  • Re: A little help please!
    ... This so far was the best map to getting DVD media working I am going to ... Also I have the latest libdvdcss2 and libdvdcss2-dev installed. ... sudo aptitude install totem-xine ... Click either free or non-free depending on where the package you ...
    (Ubuntu)
  • problem installing cedet and ecb for emacs
    ... I am trying to install these packages to enhance emacs for programming ... Initializing package states... ... dpkg: dependency problems prevent configuration of ede: ... dpkg: dependency problems prevent configuration of semantic: ...
    (Debian-User)
  • Re: Code correctness, and testing strategies
    ... automate the testing a bit more. ... the shell scripts & control files work correctly, that the debian ... package had all the files in the correct places etc). ... Install the package under a chroot ...
    (comp.lang.python)