Because the pkgrm command updates information in the software products database, it is important when you remove a package to use the pkgrm command--even though you might be tempted to use the rm command instead. For example, you could use the rm command to remove a binary executable file, but that is not the same as using pkgrm to remove the software package that includes that binary executable. Using the rm command to remove a package's files will corrupt the software products database. (If you really only want to remove one file, you can use the removef command, which will update the software product database correctly. See the removef(1) man page for more information.)
Remove an installed package.
# pkgrm pkg-abbrev... |
pkg-abbrev |
Is the name of one or more packages (separated by spaces). If omitted, pkgrm removes all available packages. |
Verify that the package has successfully been removed, use the pkginfo command.
$ pkginfo | egrep pkg-abbrev |
If pkg-abbrev is installed, the pkginfo command returns a line of information about it. Otherwise, pkginfo returns the system prompt.
Remove a software package from a client system's server with the pkgrm -R command.
server# pkgrm -R rootpath pkg-abbrev... |
-R rootpath |
Specifies the mount point of the client's root file system. |
pkg-abbrev |
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 system's package database that are marked shared are not removed from the server, but are removed from the client system's database. If all client systems have removed the package, you can remove the shared files from the server using a separate invocation of pkgrm on the server.
Verify that the package has successfully been removed, use the pkginfo command.
server$ pkginfo -R rootpath | egrep pkg-abbrev |
If pkg-abbrev is installed, the pkginfo command returns a line of information about it. Otherwise, pkginfo returns the system prompt.
If you are ready to go to the next task, see "How to Transfer Your Package to a Distribution Medium".
In the following example, assume the client system's root file system is shared. Also, assume these commands are executed on the client system'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 . . . server# |