MacPorts 升级后失去以 sudo 身份运行的能力

发布于 2024-12-15 20:53:01 字数 551 浏览 1 评论 0原文

我最近将 MacPorts 从 1.9.2 升级到 2.0.3。从那时起,我就失去了以 sudo 身份运行的能力。

sudo: can't stat /opt/local/etc/sudoers: No such file or directory
sudo: no valid sudoers sources found, quitting

不确定这些是否相关,但我想知道目前最好的行动方案是什么。

port Installation 返回

sudo @1.7.4p2_0
sudo @1.7.7_0 (active)

进一步调查表明我安装了 MacPorts 的 sudo,但没有附带 /opt/local/etc/sudoers 文件。我已经设法使用 visudo 创建这样一个文件,复制 /etc/sudoers 的内容,chmod 到 0440 并将所有权复制到 root:wheel。

我想现在的问题是我应该使用MacPorts的sudo还是卸载它?我最后是如何安装 MacPorts 的 sudo 的呢?

I recently updgraded MacPorts from 1.9.2 to 2.0.3. Since then, I've lost the ability to run as sudo.

sudo: can't stat /opt/local/etc/sudoers: No such file or directory
sudo: no valid sudoers sources found, quitting

Unsure if these are related, but I'm wondering what the best course of action is at this point.

port installed returns

sudo @1.7.4p2_0
sudo @1.7.7_0 (active)

Further investigation suggests I've installed MacPorts' sudo without an accompanying /opt/local/etc/sudoers file. I've managed to create such a file using visudo, copying the content of /etc/sudoers, chmod to 0440 and ownership to root:wheel.

I guess the question now is whether I should use MacPorts' sudo or uninstall it? And how did I end up with installing the MacPorts' sudo?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文