System Administration Guide, Volume I

Removing Packages From Servers and Standalone Systems


Caution - Caution -

Always use the pkgrm command to remove installed packages. Do not use the rm command, which will corrupt the system's record-keeping of installed packages.


How to Remove a Package

  1. Log in to the system as superuser.

  2. Remove an installed package.


    # pkgrm pkgid ...

    pkgid

    (Optional) Is the name of one or more packages (separated by spaces). If omitted, pkgrm removes all available packages.

How to Remove a Spooled Package

  1. Log in as superuser.

  2. Remove a package from a spool directory with the pkgrm -s command.


    # pkgrm -s spooldir pkgid ... 

    -s spooldir

    Specifies the name of the spool directory where the package was spooled. 

    pkgid

    (Optional) Is the name of one or more packages (separated by spaces). If no pkgid is supplied, pkgrm prompts the user to remove each package listed in the spool directory. If omitted, pkgrm removes all available packages.

How to Remove a Diskless or AutoClient System's Package

  1. Log in to the server and become superuser.

  2. Remove a software package from a diskless client's OS server with the pkgrm -R command.


    server# pkgrm -R rootpath pkgid ...

    -R rootpath

    Specifies the mount point of the client's root file system. 

    pkgid

    (Optional) Is the name of one or more packages (separated by spaces) to be removed. If omitted, pkgrm removes all available packages.

    Files in the client's package database that are marked shared are not removed from the server, but are removed from the client's database. If all clients have removed the package, you can remove the shared files from the server by using a separate invocation of pkgrm on the server.

  3. Verify that the package has been removed successfully by using the pkginfo command.


    server# pkginfo -R rootpath | egrep pkgid
    

    If pkgid is installed, the pkginfo command returns a line of information about it. Otherwise, pkginfo returns the system prompt.

Example--Removing a Diskless Client's Package

In the following example, assume the client's root file system is shared. Also, assume these commands are executed on the client's server.


server# pkgrm -R /export/root/client-1 SUNWaudio
The following package is currently installed.
SUNWaudio
Do you want to remove this package? y/n/q?
 
y
	.
	.
	.