Solaris: Remove / uninstall the software / package

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

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 4 comments so far... add one
CategoryList of Unix and Linux commands
Disk space analyzersncdu pydf
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
4 comments… add one
  • ppa108 Mar 16, 2009 @ 9:57

    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.

  • saurabh ahuja Jul 5, 2011 @ 9:10

    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?

  • saurabh ahuja Jul 5, 2011 @ 16:05

    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


  • Hrishikesh Mali Aug 28, 2015 @ 6:11

    Hi Vivek,

    What is the difference between “pkgrm” and “pkg uninstall” commands?

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum