Uninstalling / deleting "pkg" in jails

Hi.

Kind of new to FreeBSD (I installed 14.3-RELEASE), I'm exploring jails (through bastille), to see if I can replicate my home server setup that I have with Linux and docker. So far so good, most everything is setup and working, but I have a very tiny question.

I'm installing software through "pkg" in my jails. I find that after I ran "pkg install nginx", pkg and its files (pkg, pkg-binary, cache, database, libs), almost 80% of the jail's space, depending on what I use each jail for, of course.

Is there a way to uninstall pkg (or something to automate the deletion of all of its files) ? On docker it's usually standard practice to clean the package manager's repos (if there are any) in the Dockerfile, wondering what is the equivalent in the FreeBSD / jail world.

Thanks
 
I'm installing software through "pkg" in my jails. I find that after I ran "pkg install nginx", pkg and its files (pkg, pkg-binary, cache, database, libs),
...
Is there a way to uninstall pkg (or something to automate the deletion of all of its files) ?
You can use following apps to clean up the system of packages and package related installed files, database entries:

pkg-delete(8) ("deletes packages from the database and the system")
pkg-autoremove(8) ("removes orphan packages")
pkg-clean(8) ("clean the local cache of fetched remote packages").
 
Thanks for the replies !

pkg clean -a seems to remove unneeded cache indeed! thanks!

I did try pkg delete pkg before but I totally missed the --force flag

I was a bit over my head and missed the obvious :')
 
Back
Top