pkg icon indicating copy to clipboard operation
pkg copied to clipboard

pkg feature request: It is recommended to impose additional restrictions on uninstalling the pkdbase package using pkg.

Open ykla opened this issue 6 months ago • 1 comments

It is recommended to impose additional restrictions on uninstalling the pkdbase package using pkg. Otherwise, the same mistakes made on Linux will be repeated. Currently, running pkg delete pkg requires the -f flag, and I believe this should apply even more strictly to pkgbase packages. According to my testing, it is currently possible to uninstall the kernel using pkg without any obstacles, and after a reboot, the system is gone.

This issue is very common on Linux — inexperienced users often uninstall critical components like the kernel, glibc, or Python. This happens because Linux lacks a concept of a base system and has no mechanism to protect such essential software. FreeBSD, on the other hand, is different: it has a clearly defined base system.

Pkg knows to require the -f option when uninstalling itself, but the kernel can be uninstalled freely, which is unreasonable.

Image

ykla avatar Jun 08 '25 09:06 ykla

The kernel package should be marked vital, I guess.

arrowd avatar Jun 08 '25 09:06 arrowd

this is not a pkg issue, but a pkgbase one, this has to be dealt within the FreeBSD repo directly not in pkg (via vital flags for example).

bapt avatar Aug 26 '25 14:08 bapt