Solaris: Remove / uninstall the software / package

last updated in Categories Howto, Solaris, UNIX

You need to use pkgrm command which will remove a previously installed or partially installed package from the system. A check is made to determine if any other packages depend on the one being removed. If a dependency exists, the action taken is defined in the admin file.


The default state for the command is in interactive mode, meaning that prompt messages are given during processing to allow the administrator to confirm the actions being taken. Non-interactive mode can be requested with the -n option.

pkgrm command syntax

Use the following command syntax
pkgrm packagename
The following example removes SUNWgtar (GNU Tar):
pkgrm SUNWgtar

The following example removes all instances of SUNWjunk:
# pkgrm -R /export/root/client1 SUNWjunk*


  • -R root_path : Defines the full path name of a directory to use as the root_path . All files, including package system information files, are relocated to a directory tree starting in the specified root_path .

See the pkgrm(1M) man page for information and options:
man 1 pkgrm


Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

4 comment

  1. I have a problem. I download and install the packages like expat,libgcc etc. which are in sparc version and installed in intel solaris 10 server with gunzip and pkgadd -d command.
    When I tried to remove, i don’t know where to find the path.
    Help me.
    Thanks very much in advance.

  2. I am getting this error while removing package even when was root:
    “Do you want to remove this package? [y,n,?,q] y
    pkgrm: ERROR: unable to change current working directory to ” then I went to location /var/sadm/pkg/SUNWgnu-emacs-x and it doesn’t had install folder. Now how can i remove my unwanted package?

  3. well I have emacs installed on solaris and I tried to uninstall this as well but it didn’t worked any idea?

    “oracle@solaris:~# pkg uninstall SUNWgnu-emacs-x
    Creating Planpkg: ‘SUNWgnu-emacs-x’ matches no installed packages


    Have a question? Post it on our forum!