It looks like pkg remove <pkg> is able to remove a package installed via ports. But I didn't find any packages built by typing make in the ports dir. So what's the magic here? How does pkg remove know about the files belonging to a packge?

  • I don't use FreeBSD, but in OpenBSD the package database is in /var/db/pkg and contains all information needed for removing (etc.) packages. I'm sure this well explained in a FreeBSD manual for one of the package tools. Try man pkg.
    – Kusalananda
    Dec 29, 2016 at 8:24

1 Answer 1


Using make install in the ports collection registers the package to the FreeBSD package system (by creating a temporary package manifest from the port and running pkg register). From this the pkg command knows what is installed and how to remove it.

a simple make install will install the application and register it with the package system.

About FreeBSD Ports

It is also stated in the FreeBSD handbook that you can use pkg to remove installed ports.

Installed ports can be uninstalled using pkg delete.

Using the Ports Collection

  • @JdeBP thanks for the edit. Including the creation of temporary manifest was a good clarification.
    – StefanR
    Dec 29, 2016 at 9:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .