1.\" $OpenBSD: pkg_delete.1,v 1.59 2018/07/10 10:20:51 espie Exp $ 2.\" 3.\" Documentation and design originally from FreeBSD. All the code has 4.\" been rewritten since. We keep the documentation's notice: 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 15.\" Jordan K. Hubbard 16.\" 17.\" 18.Dd $Mdocdate: July 10 2018 $ 19.Dt PKG_DELETE 1 20.Os 21.Sh NAME 22.Nm pkg_delete 23.Nd delete software package distributions 24.Sh SYNOPSIS 25.Nm pkg_delete 26.Op Fl acIimnqsVvXx 27.Op Fl B Ar pkg-destdir 28.Op Fl D Ar name Ns Op = Ns Ar value 29.Op Ar pkg-name ... 30.Sh DESCRIPTION 31The 32.Nm 33command is used to delete packages that have been previously installed 34with the 35.Xr pkg_add 1 36command. 37.Pp 38Package names may be specified either as the package name itself, or as a 39filename which consists of the package name plus the 40.Dq .tgz 41suffix, or as a full pathname like 42.Pa /var/db/pkg/pkgname , 43so that shell wildcards can be used. 44.Pp 45Version numbers and flavors 46.Po 47see 48.Xr packages-specs 7 49.Pc 50can be omitted, unless the resulting specification is ambiguous. 51.Pp 52Otherwise, 53.Ar pkg-name 54in 55.Nm 56may use the same convenient shortcuts as 57.Xr pkg_add 1 : 58.Sq Nm Ar autoconf Ns % Ns Ar 2.13 59will delete 60.Ar autoconf 61from the 62.Ar 2.13 63branch. 64.Pp 65.Nm 66will 67.Xr syslog 3 68deletions by default. 69.Pp 70.Nm 71relies on the file system information being consistent. 72In case of a system crash, 73.Pa /var/db/pkg 74may become corrupted. 75Use 76.Xr pkg_check 8 77to repair things. 78.Pp 79.Nm 80may ask questions in interactive mode, or error out otherwise. 81Interactive mode is the default on a tty, see 82options 83.Fl I/i . 84.Pp 85The options are as follows: 86.Bl -tag -width Ds 87.It Fl a 88Delete unused dependencies (packages that are not needed by anything tagged 89as installed manually). 90Can be used without 91.Ar pkgnames . 92If used with 93.Ar pkgnames , 94it will only delete non manual installs in the list. 95.It Fl B Ar pkg-destdir 96Set 97.Ar pkg-destdir 98as the prefix to prepend to any object deleted. 99.It Fl c 100Delete extra configuration file, mentioned as 101.Dl @extra file 102in the packing-list. 103.It Fl D Ar name Ns Op = Ns Ar value 104Force removal of the package. 105.Ar name 106is a keyword that states what failsafe 107should be waived. 108Recognized keywords include: 109.Pp 110.Bl -tag -width "dependenciesXX" -compact 111.It Cm baddepend 112Force the deletion of packages even if they reference nonexistent dependencies. 113.It Cm checksum 114Verify checksums before deleting files. 115.It Cm dependencies 116Also delete the whole set of packages that depends upon the requested packages. 117.It Cm nonroot 118Uninstall even if not running as root. 119.It Cm scripts 120External scripts may fail. 121.El 122.It Fl I 123Force non-interactive mode. 124Default is to be interactive when run from a tty. 125.It Fl i 126Force interactive mode, even if not run from a tty. 127.Nm 128may ask questions to the user if faced with difficult decisions. 129.It Fl m 130Causes 131.Nm 132to always display the progress meter in cases it would not do so by default. 133.It Fl n 134Don't actually deinstall a package, just report the steps that 135would be taken if it were. 136.It Fl qq 137Do not bother with checksums for configuration files. 138.It Fl s 139Don't actually deinstall packages, report the disk size changes 140that would happen. 141.It Fl V 142Turn on statistics output. 143For now, only displays the number of packages done/total number of packages. 144Several 145.Fl V 146will turn on more statistics in the future. 147.It Fl v 148Turn on verbose output. 149Several 150.Fl v 151turn on more verbose output. 152By default, 153.Nm 154is almost completely silent, but it reacts to keyboard status requests 155.Po 156see 157.Xr stty 1 158.Pc . 159.Fl v 160turns on basic messages, 161.Fl vv 162adds relevant system operations, 163.Fl vvv 164shows most internal computations apart from individual file/directory 165additions, and 166.Fl vvvvv 167shows everything. 168.It Fl X 169Delete everything, except the list of packages that follow. 170.It Fl x 171Disable progress meter. 172.El 173.Sh TECHNICAL DETAILS 174.Nm 175examines installed package records for the 176.Ar pkgname 177specified, checks inter-dependencies between installed packages, 178deletes the package contents in an order respecting dependencies 179(e.g., packages with dependencies get removed first), and finally 180removes the package records. 181.Pp 182If a package is required by other installed packages not mentioned in 183the list of packages to remove, 184.Nm 185will list those dependent packages and refuse to delete the package. 186.Sh ENVIRONMENT 187.Bl -tag -width PKG_CHECKSUM 188.It Ev PKG_CHECKSUM 189If set, verify files checksums during deletion, exactly like 190.Fl D Ns Cm checksum . 191.It Ev PKG_DBDIR 192Where to look for installed packages instead of 193.Pa /var/db/pkg . 194.El 195.Sh SEE ALSO 196.Xr pkg_add 1 , 197.Xr pkg_create 1 , 198.Xr pkg_info 1 , 199.Xr packages-specs 7 , 200.Xr pkg_check 8 201.Sh AUTHORS 202.Bl -tag -width indent -compact 203.It An Jordan Hubbard 204initial design 205.It An Marc Espie 206complete rewrite 207.El 208