pkg_delete(1)               NetBSD Reference Manual              pkg_delete(1)

NNAAMMEE
     ppkkgg__ddeelleettee - a utility for deleting previously installed software package
     distributions

SSYYNNOOPPSSIISS
     ppkkgg__ddeelleettee [--vvDDddnnff] [--pp _p_r_e_f_i_x] _p_k_g_-_n_a_m_e _._._.

DDEESSCCRRIIPPTTIIOONN
     The ppkkgg__ddeelleettee command is used to delete packages that have been previ-
     ously installed with the pkg_add(1) command.


WWAARRNNIINNGG
     _S_i_n_c_e _t_h_e ppkkgg__ddeelleettee _c_o_m_m_a_n_d _m_a_y _e_x_e_c_u_t_e _s_c_r_i_p_t_s _o_r _p_r_o_g_r_a_m_s _p_r_o_v_i_d_e_d _b_y
     _a _p_a_c_k_a_g_e _f_i_l_e_, _y_o_u_r _s_y_s_t_e_m _m_a_y _b_e _s_u_s_c_e_p_t_i_b_l_e _t_o _`_`_t_r_o_j_a_n _h_o_r_s_e_s_'_' _o_r
     _o_t_h_e_r _s_u_b_t_l_e _a_t_t_a_c_k_s _f_r_o_m _m_i_s_c_r_e_a_n_t_s _w_h_o _c_r_e_a_t_e _d_a_n_g_e_r_o_u_s _p_a_c_k_a_g_e _f_i_l_e_s_.

     _Y_o_u _a_r_e _a_d_v_i_s_e_d _t_o _v_e_r_i_f_y _t_h_e _c_o_m_p_e_t_e_n_c_e _a_n_d _i_d_e_n_t_i_t_y _o_f _t_h_o_s_e _w_h_o _p_r_o_-
     _v_i_d_e _i_n_s_t_a_l_l_a_b_l_e _p_a_c_k_a_g_e _f_i_l_e_s_.  _F_o_r _e_x_t_r_a _p_r_o_t_e_c_t_i_o_n_, _e_x_a_m_i_n_e _a_l_l _t_h_e
     _p_a_c_k_a_g_e _c_o_n_t_r_o_l _f_i_l_e_s _i_n _t_h_e _p_a_c_k_a_g_e _r_e_c_o_r_d _d_i_r_e_c_t_o_r_y _( _/_v_a_r_/_d_b_/_p_k_g_/_<_p_k_g_-
     _n_a_m_e_>_/ _)_. _P_a_y _p_a_r_t_i_c_u_l_a_r _a_t_t_e_n_t_i_o_n _t_o _a_n_y _+_I_N_S_T_A_L_L_, _+_D_E_I_N_S_T_A_L_L_, _+_R_E_Q_U_I_R_E
     _o_r _+_M_T_R_E_E___D_I_R_S _f_i_l_e_s_, _a_n_d _i_n_s_p_e_c_t _t_h_e _+_C_O_N_T_E_N_T_S _f_i_l_e _f_o_r @@ccwwdd_, @@mmooddee
     _(_c_h_e_c_k _f_o_r _s_e_t_u_i_d_)_, @@ddiirrrrmm_, @@eexxeecc_, _a_n_d @@uunneexxeecc _d_i_r_e_c_t_i_v_e_s_, _a_n_d_/_o_r _u_s_e _t_h_e
     pkg_info_(_1_) _c_o_m_m_a_n_d _t_o _e_x_a_m_i_n_e _t_h_e _i_n_s_t_a_l_l_e_d _p_a_c_k_a_g_e _c_o_n_t_r_o_l _f_i_l_e_s_.


OOPPTTIIOONNSS
     The following command line options are supported:

     _p_k_g_-_n_a_m_e _._._.
             The named packages are deinstalled.

     --vv      Turn on verbose output.

     --DD      If a deinstallation script exists for a given package, do not ex-
             ecute it.

     --nn      Don't actually deinstall a package, just report the steps that
             would be taken if it were.

     --pp _p_r_e_f_i_x
             Set _p_r_e_f_i_x as the directory in which to delete files from any in-
             stalled packages which do not explicitly set theirs.  For most
             packages, the prefix will be set automatically to the installed
             location by pkg_add(1).

     --dd      Remove empty directories created by file cleanup.  By default,
             only files/directories explicitly listed in a package's contents
             (either as normal files/directories or with the @@ddiirrrrmm directive)
             will be removed at deinstallation time.  This option tells
             ppkkgg__ddeelleettee to also remove any directories that were emptied as a
             result of removing the package.

     --ff      Force removal of the package, even if a dependency is recorded or
             the deinstall or require script fails.


TTEECCHHNNIICCAALL DDEETTAAIILLSS
     ppkkgg__ddeelleettee does pretty much what it says.  It examines installed package
     records in _/_v_a_r_/_d_b_/_p_k_g_/_<_p_k_g_-_n_a_m_e_>, deletes the package contents, and fi-
     nally removes the package records.


     If a package is required by other installed packages, ppkkgg__ddeelleettee will
     list those dependent packages and refuse to delete the package (unless
     the --ff option is given).

     If the package contains a _r_e_q_u_i_r_e file (see pkg_create(1)),  then this is
     executed first as
           rreeqquuiirree _<_p_k_g_-_n_a_m_e_> _D_E_I_N_S_T_A_L_L
     (where _p_k_g_-_n_a_m_e is the name of the package in question and _D_E_I_N_S_T_A_L_L is a
     keyword denoting that this is a deinstallation) to see whether or not de-
     installation should continue.  A non-zero exit status means no, unless
     the --ff option is specified.

     If a ddeeiinnssttaallll script exists for the package, it is executed before any
     files are removed.  It is this script's responsibility to clean up any
     additional messy details around the package's installation, since all
     ppkkgg__ddeelleettee knows how to do is delete the files created in the original
     distribution.  The ddeeiinnssttaallll script is called as:
           ddeeiinnssttaallll _<_p_k_g_-_n_a_m_e_> _D_E_I_N_S_T_A_L_L
     Passing the keyword _D_E_I_N_S_T_A_L_L lets you potentially write only one pro-
     gram/script that handles all aspects of installation and deletion.

     All scripts are called with the environment variable PKG_PREFIX set to
     the installation prefix (see the --pp option above).  This allows a package
     author to write a script that reliably performs some action on the direc-
     tory where the package is installed, even if the user might have changed
     it by specifying the --pp option when running ppkkgg__ddeelleettee or ppkkgg__aadddd.

SSEEEE AALLSSOO
     pkg_add(1),  pkg_create(1),  pkg_info(1),  mktemp(3),  mtree(8).

AAUUTTHHOORRSS
     Jordan Hubbard
             most of the work
     John Kohl
             refined it for NetBSD

BBUUGGSS
     Sure to be some.

 FreeBSD                       November 25, 1994                             2
