Troubleshooting Solaris package removal
A co-worker was having trouble running
# pkgrm SUNWfontconfig-root
It was returning:
## Removing pathnames in class <manifest> svc:/application/font/fc-cache:default remains enabled; aborting pkgrm: ERROR: class action script did not complete successfully Removal of <SUNWfontconfig-root> failed.
To troubleshoot it, we added the -v option to pkgrm so it would show the scripts it was running:
# pkgrm -v SUNWfontconfig-root
+ [ != -a != / ] + [ -r /etc/svc/volatile/repository_door ] smf_alive=yes SVCPROP=/usr/bin/svcprop + read mfst + [ yes = yes ] + /usr/sbin/svccfg inventory /var/svc/manifest/application/font/fc-cache.xml ENTITIES=svc:/application/font/fc-cache:default svc:/application/font/fc-cache + /usr/bin/svcprop -p general/enabled svc:/application/font/fc-cache:default en_p=true + /usr/bin/svcprop -p general_ovr/enabled svc:/application/font/fc-cache:default en_o= + [ true = true -o = true ] + echo svc:/application/font/fc-cache:default remains enabled; aborting svc:/application/font/fc-cache:default remains enabled; aborting + exit 1 pkgrm: ERROR: class action script did not complete successfully
Ok, now we can see the problem. We need to change the general/enabled property of the service to false and refresh the service.
# svccfg -s svc:/application/font/fc-cache:default setprop general/enabled = false # svcadm refresh font/fc-cache:default
Verify that it took:
# /usr/bin/svcprop -p general/enabled svc:/application/font/fc-cache:default false
That looks good. Now we can retry the package removal:
# pkgrm SUNWfontconfig-root
and it worked!