I was trying to prune some packages from my fresh openSolaris 05/08
installation that I didn't think were necessary for a server deployment.
Evidently I removed one that was rather critical, as the system became
unresponsive and then would no longer boot 8-/.
After reinstalling, I decided to test out dependency handling when
uninstalling packages. I picked the SUNWgnome-libs package, as I don't need
any GUI on my headless server, and I didn't think anything critical
depended on it.
I picked a random dependency of the package, SUNWevolution-exchange:
-----
# pkg contents -m SUNWevolution-exchange
[...]
depend fmri=pkg:/SUNWgnome-libs at 0.5.11-0.86 type=require
-----
Doing a test uninstall of the SUNWgnome-libs package was not particularly
informative:
-----
# pkg uninstall -nv SUNWgnome-libs
Before evaluation:
UNEVALUATED:
-pkg:/SUNWgnome-libs at 0.5.11,5.11-0.86:20080426T174126Z
After evaluation:
pkg:/SUNWgnome-libs at 0.5.11,5.11-0.86:20080426T174126Z -> None
-----
While reviewing the documentation, I noticed this:
In the case of uninstall, the -r option will recursively
uninstall any packages which are dependent on the initial
package.
I did a test uninstall with that option:
-----
# pkg uninstall -nvr SUNWgnome-libs
Before evaluation:
UNEVALUATED:
-pkg:/SUNWgnome-libs at 0.5.11,5.11-0.86:20080426T174126Z
After evaluation:
pkg:/SUNWgnome-libs at 0.5.11,5.11-0.86:20080426T174126Z -> None
-----
Again nothing particularly informative. I thought perhaps pkg search might
reveal dependencies, but it only found the actual package itself:
-----
# pkg search SUNWgnome-libs
INDEX ACTION VALUE PACKAGE
legacy_pkg legacy SUNWgnome-libs
pkg:/SUNWgnome-libs at 0.5.11-0.86
-----
I decided to just do the uninstall and see what happened:
-----
-bash-3.2# pkg uninstall -vr SUNWgnome-libs
Before evaluation:
UNEVALUATED:
-pkg:/SUNWgnome-libs at 0.5.11,5.11-0.86:20080426T174126Z
After evaluation:
pkg:/SUNWgnome-libs at 0.5.11,5.11-0.86:20080426T174126Z -> None
PHASE ACTIONS
Removal Phase 689/689
-----
However, even though the -r option was specified, only the explicitly
listed package was removed, not any of its dependencies. In particular,
SUNWevolution-exchange was still installed.
I would prefer a packaging system that warns you if you're about to remove
a package upon which other installed packages depend. I don't want it to
prevent me from doing so, if that's what I really want, but some type of
warning and requiring a particular flag to force it would be nice.
Is there any easy way I missed to list all dependent packages for a
particular package?
Did I do something wrong in the recursive uninstall, is the documentation
incorrect, or does the packaging system have known deficiencies in that
area?
Dependency handling for the installation process seems okay, when I
attempted to install a particular explicit package, it automatically pulled
in all of its dependencies.
Thanks for any clarification...
--
Paul B. Henson | (909) 979-6361 | http://www.csupomona.edu/~henson/
Operating Systems and Network Analyst | henson at csupomona.edu
California State Polytechnic University | Pomona CA 91768