pkgask(1M) Can't Find Interactive Request Script

/pkgask-cant-find-interactive-request-script 2013-05-30T16:55:19+01:00

Here's one that doesn't come up very often, but when it does, it catches people out.

In an attempt to automate the installation of Solaris pkgs on Solaris 10 and earlier, people turn to the pkgask(1M) command thinking this is what they need to do. They read the man page and then attempt to create the response file, and it fails as follows...

# pkgask -r /var/tmp/response -d . SUNWzsh

Processing package instance <SUNWzsh> from </isos/s10u11/Solaris_10/Product>

Z shell (zsh)(sparc) 11.10.0,REV=2005.01.08.05.16
pkgask: ERROR: package does not contain an interactive request script

Processing of request script failed.
No changes were made to the system.
#

Believe it or not this is correct and expected behaviour. The issue here is you're using the wrong tool for the job.

To quote the pkgask(1M) man page:

DESCRIPTION
     pkgask allows the  administrator  to  store  answers  to  an
     interactive  package  (one with a request script, that is, a
     user-created file that must  be  named  request).

Now what isn't clear here is pkgask(1M) is only useful for pkgs that include a script called PKGname/install/request. The request script is usually used to configure the application once the pkg has been installed.

If we look at the SUNWzsh pkg I used in the example, we'll see that file doesn't exist...

# ls -l SUNWzsh/install
total 10
-rwxr-xr-x   1 root     staff       1097 Dec 21  2009 copyright
-rwxr-xr-x   1 root     staff        875 Apr 15  2011 depend
-rw-r--r--   1 root     staff       2369 Jan 17 18:32 i.none
#

This means we can't use pkgask(1M) to generate a response file to automate our installation of this pkg.

What you actually want is to use an admin file. To quote the pkgadd(1M) man page...

     -a admin

         Define an installation administration file, admin, to be
         used  in  place  of the default administration file. The
         token none overrides the use of any admin file, and thus
         forces  interaction  with  the  user. Unless a full path
         name is given, pkgadd first looks in the current working
         directory  for the administration file. If the specified
         administration file is not in the current working direc-
         tory, pkgadd looks in the /var/sadm/install/admin direc-
         tory for the administration file.

... and later in the man page ...

     If the default admin file is too restrictive,  the  adminis-
     tration  file  may  need  to  be modified to allow for total
     non-interaction during a package installation. See  admin(4)
     for details.

So what you actually need to perform a non-interactive installation of this pkg is an admin file. You will need this for pkgs that contain request scripts too.

Simply copy the default - /var/sadm/install/admin - to a convenient location and replace all instances of "ask" with a value that suits your needs. Refer to the admin(4) man page for acceptable values. You can then install your pkg, non-interactively using "pkgadd -a /path/to/your/admin -d /path/to/pkg YOURpkg".

Copyright © 2005 - 2018 Colin Seymour All rights reserved. Privacy Policy.
Check out the feed if you do the RSS/Atom thing.