Removing non-root Db2 database products using db2_deinstall (Linux and UNIX)

This task provides steps for removing non-root Db2 database products or components using the db2_deinstall command.

Before you begin

You must stop the non-root instance before running the db2_deinstall command.

About this task

  • This task applies to Db2 database products that were installed without root user authority. A separate task exists for uninstalling Db2 database products that were installed with root user authority.
  • As with root users, non-root users can use the db2_deinstall command to uninstall Db2 database products. The db2_deinstall command for non-root installations has the same options as root installations, and has an extra option: -f sqllib.
  • It is important to note that running db2_deinstall as a non-root user uninstalls the Db2 database product and drops the non-root instance. This is different than root installations, where running db2_deinstall only uninstalls the Db2 database program files.
  • You cannot remove Db2 database products using a native operating system utility, such as rpm or SMIT.


To uninstall a Db2 database product that was installed by a non-root user:

  1. Log in with the user ID that was used to install the Db2 database product.
  2. Navigate to the $HOME/sqllib/install directory, where $HOME is your home directory.
  3. Run the db2_deinstall command.
    • If you run the db2_deinstall command with the -a option, the Db2 database program files are removed, but any configuration files are left behind in a backup directory called sqllib_bk.
    • If you run the db2_deinstall command with the -a -f sqllib option, the entire sqllib subdirectory in your home directory will be removed. If you have any files in sqllib you want to keep, be sure to copy them elsewhere before running db2_deinstall -a -f sqllib.
    • As with root installations, running the db2_deinstall command with the -F option against a non-root installation allows the non-root user to remove specific Db2 features.