Removing a package from a pkg(5) repository
By ckamps on Feb 24, 2009
Recently, several people have asked about how to remove a package from a pkg(5) repository.
First, there isn't any tool for doing this. Generally, once a package is published to a repository, it is meant to stay there forever. People may have installed the package into images and if they run a "pkg fix", the content of the package might again be needed from the repository. But during development, cases arise in which a package might be published to a repository by mistake, and there is a desire to remove it before anyone installs it.
The manual steps for removing a package are:
1) Remove the package manifest from the $REPO/pkg directory
2) Remove the package entry from $REPO/catalog/catalog file
3) Remove any references to the package from any files in the $REPO/updatelog directory
4) Edit the $REPO/catalog/attrs file to bump the package count down one
This is all without using the --rebuild option with pkg.depotd. If you do just step (1) and then start pkg.depotd with --rebuild, then steps 2-4 will be done for you, except that all of the files in the updatelog directory will be erased. The impact of not having updatelog files is:
a) Clients will not receive incremental updates of catalogs. If the updatelog files are not there, the clients will always receive the full catalog.
b) The RSS feed of recently added packages will be empty if the updatelog files are not there.