DELPKG(8) System Manager's Manual DELPKG(8)

delpkg — remove an installed package

delpkg [-f] [-r root] package

delpkg -h | -v

delpkg removes the installed package named package. It must be run as root.

It refuses to remove a package that owns the modules of the running kernel, lib/modules/release, or the last package owning anything under lib/modules/, since that would leave no bootable kernel. The first check is only made when the root is /.

The removal runs these steps, in order:

  1. Read the package metadata.
  2. Disable the declared services: remove the /service/name link, then stop the service with sv exit if it is running.
  3. Remove the package's files, deepest first. Files and directories that another package owns are kept. Leftover file.new copies of its configuration files are removed as well.
  4. Remove the now empty service directories under /etc/sv.
  5. Run ldconfig(8) and the triggers described in addpkg(8).
  6. Remove the declared users, and the declared groups that no other installed package declares. Groups of the base system are never removed.
  7. Remove the package from the database.

The options are as follows:

Remove a kernel package despite the checks above.
Print a usage summary.
root
Remove from root instead of /.
Print the version.

Root if -r is not given.
Package database directory; see addpkg(8).

/var/lib/pkg/db
Package database.
/var/lib/pkg/meta/name
Package metadata.

The delpkg utility exits 0 on success, and >0 if an error occurs. It fails if the files were removed but the database could not be written.

addpkg(8), infopkg(8), pkg(8)

September 27, 2026 mkpkg 1.6.0