Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicit warning when root is needed to upgrade DB #1908

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tigergao99
Copy link
Contributor

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

@ceri
Copy link

ceri commented Nov 24, 2020

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

@tigergao99
Copy link
Contributor Author

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

@bapt
Copy link
Member

bapt commented Dec 2, 2020

You should also check for "install as user" concept

@grahamperrin
Copy link
Contributor

Context:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'pkg which' attempts to write in the SQLite database
4 participants