gpt4 book ai didi

gnupg - gpg 列表键错误 trustdb 不可写

转载 作者:行者123 更新时间:2023-12-01 07:27:31 25 4
gpt4 key购买 nike

当我尝试列出我的 gpg key 时出现错误:

gpg --list-keys
gpg: NOTE: trustdb not writable
gpg: checking the trustdb
gpg: trustdb rec 56: write failed (n=-1): Bad file descriptor
gpg: trustdb: sync failed: Bad file descriptor

我尝试在我的用户目录上执行递归 chown。但这似乎并没有解决问题。

卷不是只读的:

  [web1:~] bluethundr% touch test
[web1:~] bluethundr% echo hi > test
[web1:~] bluethundr% cat test
hi

所以我想知道为什么 trustdb 不可写。

我该如何解决这个问题?

最佳答案

这似乎已在 bug 771976 中报告过

I found this when running the command apt-key list on a machine where the root filesystem is normally mounted read-only.
This results in running gpg with "--trustdb-name", "/etc/apt//trustdb.gpg", "--list-keys".
gpg in turn attempts to create "/etc/apt//trustdb.gpg.lock" in order to lock the trustdb, which fails.

Seeing how --list-keys is an operation which shouldn't require writing to anything, having it fail in this situation is bad.

即使卷不是只读的,检查(使用 strace)gpg --list-key 试图创建它的 trustdb.gpg.lock文件。

 strace gpg --list-key | grep trustdb.gpg.lock

OP bluethundr添加 in the comments :

I changed to the .gnupg directory and did a list.
I saw that the files in there were owned by root! So I did a sudo chown -R myuser:myuser *.
Then I ran gpg --list-keys again and it worked!
The problem was that the files in .gnupg were owned by root for some reason.

关于gnupg - gpg 列表键错误 trustdb 不可写,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41916857/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com