pkg icon indicating copy to clipboard operation
pkg copied to clipboard

Explicit warning when root is needed to upgrade DB

Open tigergao99 opened this issue 4 years ago • 5 comments

Prints an explicit warning when errmsg has the substring "readonly".
Fixes #1771

tigergao99 avatar Nov 19 '20 21:11 tigergao99

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).

ceri avatar Nov 24 '20 12:11 ceri

Thanks for the catch. Now using geteuid() to check if user is root.

tigergao99 avatar Nov 24 '20 15:11 tigergao99

You should also check for "install as user" concept

bapt avatar Dec 02 '20 03:12 bapt

Context:

% pkg update -f
pkg: Insufficient privileges to update the repository catalogue.
% pkg query %v pkg
1.18.4
% 

grahamperrin avatar Oct 08 '22 19:10 grahamperrin