pkg
pkg copied to clipboard
Explicit warning when root is needed to upgrade DB
Prints an explicit warning when errmsg has the substring "readonly".
Fixes #1771
Could this also check that pkg isn't running as root, otherwise it's possible that this may give a misleading error explanation (if the filesystem is read-only, for example).
Thanks for the catch. Now using geteuid() to check if user is root.
You should also check for "install as user" concept
Context:
% pkg update -f
pkg: Insufficient privileges to update the repository catalogue.
% pkg query %v pkg
1.18.4
%