wpkg --recursive | -R ...

Short Hand

wpkg -R

The --recursive option is used to request the packager to work recursively. The exact meaning depends on the function as defined below.

Repository Index (--create-index)

When creating a set of packages, it is convenient to put them in a repository (i.e. a directory.) When the set grows fairly large, using sub-directories can become most useful. The --create-index command understands the --recursive option for that purpose as it then creates the index.tar.gz file using all the files in your repository directory and all the sub-directories.

wpkg --recursive --create-index REP

Note that the --install command actually makes use of the exact same process to automatically create the index.tar.gz file for you when it does not already exist (however, it does not update that index!)

Installation (--install)

In case of an installation the recursive option refers to repository directories. By default only the files defined in that very directory are read as dependencies. When the --recursive flag is used, all the sub-directories are also read for dependencies.

wpkg --recursive --repository REP --install A

This command line example tells wpkg to install A and if any dependencies are necessary (A depends on them and they were not yet installed) to look in the REP directory and all of its sub-directories.

Removal (--remove)

In case of a package removal, the --recursive option means that packages that depend on the packages being explicitly removed will all be removed automatically (note that is different from the --autoremove which only starts removing packages that are NOT depended on.)

For example one day you installed package A.

wpkg --install A.deb

Later you install package B which depends on package A.

wpkg --install B.deb

The next day you want to remove package A. As is, wpkg generates an error letting you know that A has packages that depend on it being installed (B in our example,) and that prevent its removal.

wpkg --remove A

You could change the command line and include both packages which would get rid of the error (note that the order is not important).

wpkg --remove A B

However, A may depend on many more packages and it may be difficult to determine all those packages and even more tedious to type all of their names on the command line. Instead you may use the --recursive flag.

wpkg --recursive --remove A

This works the same way, only you do not need to know what A depends on.


It is obviously dangerous to use the --recursive option while removing packages since it may result in many packages getting removed, some of which you may want to keep installed.