mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-22 23:00:57 +08:00
translated
This commit is contained in:
parent
3d2c7e4b04
commit
032864c03f
@ -1,144 +0,0 @@
|
||||
[#]: subject: "Fixing “Key is stored in legacy trusted.gpg keyring” Issue in Ubuntu"
|
||||
[#]: via: "https://itsfoss.com/key-is-stored-in-legacy-trusted-gpg/"
|
||||
[#]: author: "Abhishek Prakash https://itsfoss.com/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Fixing “Key is stored in legacy trusted.gpg keyring” Issue in Ubuntu
|
||||
======
|
||||
|
||||
If you use a PPA or add an external repository in Ubuntu 22.04 and later versions, chances are that you will see a message like this:
|
||||
|
||||
```
|
||||
W: https://packagecloud.io/slacktechnologies/slack/debian/dists/jessie/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
|
||||
```
|
||||
|
||||
![ubuntu key is stored legacy][1]
|
||||
|
||||
First thing first. It is not an error, it is a warning message. A warning does not stop the procedure. You can continue upgrading your system even if you see this warning message during an update.
|
||||
|
||||
If you don’t like seeing the warning message, you can take some manual steps to get rid of it.
|
||||
|
||||
There are two ways; the proper way and the quick and dirty way. Read both methods and see which one you feel comfortable with.
|
||||
|
||||
### Method 1: Import the key [Proper but complicated way]
|
||||
|
||||
First, list all the GPG keys added to your system.
|
||||
|
||||
```
|
||||
sudo apt-key list
|
||||
```
|
||||
|
||||
This will show a huge list of keys stored in your system. What you have to do here is to look for the keys associated with the warning message.
|
||||
|
||||
```
|
||||
[email protected]:~$ sudo apt-key list
|
||||
[sudo] password for abhishek:
|
||||
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
|
||||
/etc/apt/trusted.gpg
|
||||
--------------------
|
||||
pub rsa4096 2014-01-13 [SCEA] [expired: 2019-01-12]
|
||||
418A 7F2F B0E1 E6E7 EABF 6FE8 C2E7 3424 D590 97AB
|
||||
uid [ expired] packagecloud ops (production key) <[email protected]>
|
||||
|
||||
pub rsa4096 2016-02-18 [SCEA]
|
||||
DB08 5A08 CA13 B8AC B917 E0F6 D938 EC0D 0386 51BD
|
||||
uid [ unknown] https://packagecloud.io/slacktechnologies/slack (https://packagecloud.io/docs#gpg_signing) <[email protected]>
|
||||
sub rsa4096 2016-02-18 [SEA]
|
||||
|
||||
/etc/apt/trusted.gpg.d/audio-recorder-ubuntu-ppa.gpg
|
||||
----------------------------------------------------
|
||||
pub rsa4096 2015-08-30 [SC]
|
||||
42EF 41ED 9813 B713 D4F1 F06D 5CF1 2638 ACF9 669F
|
||||
uid [ unknown] Launchpad PPA for Team audio-recorder
|
||||
|
||||
/etc/apt/trusted.gpg.d/danielrichter2007-ubuntu-grub-customizer.gpg
|
||||
-------------------------------------------------------------------
|
||||
pub rsa1024 2010-10-08 [SC]
|
||||
59DA D276 B942 642B 1BBD 0EAC A8AA 1FAA 3F05 5C03
|
||||
```
|
||||
|
||||
How do you do that? Read the message carefully.
|
||||
|
||||
```
|
||||
W: https://packagecloud.io/slacktechnologies/slack/debian/dists/jessie/InRelease: Key is stored in legacy
|
||||
```
|
||||
|
||||
In my case, the repository has keywords like packagecloud, slacktechnologies. It is shown at the top of the apt-key list output. You may have to scroll a bit in your case.
|
||||
|
||||
In this rare case, the external repository added by Slack, has two GPG keys. One of them is expired and I’ll ignore it. You may not have such a situation.
|
||||
|
||||
You should the last 8 characters (excluding the space) under the line after pub.
|
||||
|
||||
```
|
||||
/etc/apt/trusted.gpg
|
||||
--------------------
|
||||
pub rsa4096 2014-01-13 [SCEA] [expired: 2019-01-12]
|
||||
418A 7F2F B0E1 E6E7 EABF 6FE8 C2E7 3424 D590 97AB
|
||||
uid [ expired] packagecloud ops (production key) <[email protected]>
|
||||
|
||||
pub rsa4096 2016-02-18 [SCEA]
|
||||
DB08 5A08 CA13 B8AC B917 E0F6 D938 EC0D 0386 51BD
|
||||
uid [ unknown] https://packagecloud.io/slacktechnologies/slack (https://packagecloud.io/docs#gpg_signing) <[email protected]>
|
||||
```
|
||||
|
||||
So from the line “DB08 5A08 CA13 B8AC B917 E0F6 D938 EC0D 0386 51BD”, I’ll take the last 8 characters “0386 51BD”, remove the space and then use it to import the GPG key in its dedicated file under the /etc/apt/trusted.gpg.d directory:
|
||||
|
||||
```
|
||||
sudo apt-key export 038651BD | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/slack.gpg
|
||||
```
|
||||
|
||||
I created a new file slack.gpg here, in case you didn’t notice it. I named it slack.gpg because it is associated with Slack application I installed earlier. The filename does not matter but it’s good for identification.
|
||||
|
||||
If the command runs successfully, you won’t see any message. You can verify that by checking if the newly created gpg file exists or not.
|
||||
|
||||
![import gpg key to trusted ubuntu][2]
|
||||
|
||||
Run the update again and now you should not see the warning message anymore.
|
||||
|
||||
### Method 2: Copy to the trusted.gpd.d directory [Quick and dirty way]
|
||||
|
||||
If you don’t feel comfortable doing all the above stuff manually, well, you can ignore the warning message. I mean, ignoring it is always an option.
|
||||
|
||||
Another option is to copy the /etc/apt/trusted.gpg file to /etc/apt/trusted.gpg.d directory. After all, Ubuntu only complains that it needs the GPG keys in /etc/apt/trusted.gpg.d directory.
|
||||
|
||||
You’ll still have to use the terminal. Open it and use the following command:
|
||||
|
||||
```
|
||||
sudo cp /etc/apt/trusted.gpg /etc/apt/trusted.gpg.d
|
||||
```
|
||||
|
||||
Now, if you run the update, you won’t see the “Key is stored in legacy trusted.gpg keyring” warning message anymore.
|
||||
|
||||
![quick dirty way to fix apt key stored legacy][3]
|
||||
|
||||
### Conclusion
|
||||
|
||||
I have written a detailed article on [apt-key deprecation][4]. Apparently, that article had some readers confused and hence I wrote this one to give them direct steps for getting rid of the message.
|
||||
|
||||
As I said before, it is a warning message and can be ignored for now. The onus to ‘fix’ this issue lies on the external software developers and Ubuntu developers. The external software developers should make sure that their GPG keys are no longer added in the /etc/apt/trusted.gpg file.
|
||||
|
||||
The end users should not take the pain for their laziness.
|
||||
|
||||
So, which method did you use to get rid of the ‘key is stored in legacy’ warning message? The first one or the second one?
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/key-is-stored-in-legacy-trusted-gpg/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://itsfoss.com/wp-content/uploads/2022/11/ubuntu-key-is-stored-legacy.png
|
||||
[2]: https://itsfoss.com/wp-content/uploads/2022/11/import-gpg-key-to-trusted-ubuntu.png
|
||||
[3]: https://itsfoss.com/wp-content/uploads/2022/11/quick-dirty-way-to-fix-apt-key-stored-legacy.png
|
||||
[4]: https://itsfoss.com/apt-key-deprecated/
|
@ -0,0 +1,144 @@
|
||||
[#]: subject: "Fixing “Key is stored in legacy trusted.gpg keyring” Issue in Ubuntu"
|
||||
[#]: via: "https://itsfoss.com/key-is-stored-in-legacy-trusted-gpg/"
|
||||
[#]: author: "Abhishek Prakash https://itsfoss.com/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
修复 Ubuntu 中的 “Key is stored in legacy trusted.gpg keyring” 问题
|
||||
======
|
||||
|
||||
如果你在 Ubuntu 22.04 及以后的版本中使用 PPA 或添加外部仓库,你有可能会看到这样的信息:
|
||||
|
||||
```
|
||||
W: https://packagecloud.io/slacktechnologies/slack/debian/dists/jessie/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
|
||||
```
|
||||
|
||||
![ubuntu key is stored legacy][1]
|
||||
|
||||
首先,这不是一个错误,而是一个警告信息。警告并不会停止程序。即使你在更新过程中看到这个警告信息,你也可以继续升级你的系统。
|
||||
|
||||
如果你不想看到这个警告信息,你可以采取一些手动步骤来摆脱它。
|
||||
|
||||
有两种方法;正确的方法和快速而不优雅的方法。阅读这两种方法,看看你对哪一种感到满意。
|
||||
|
||||
### 方法 1:导入密钥(正确但复杂的方法)
|
||||
|
||||
首先,列出所有添加到你系统中的 GPG 密钥。
|
||||
|
||||
```
|
||||
sudo apt-key list
|
||||
```
|
||||
|
||||
这将显示一个存储在你系统中的巨大的密钥列表。你在这里要做的是寻找与警告信息相关的密钥。
|
||||
|
||||
```
|
||||
[email protected]:~$ sudo apt-key list
|
||||
[sudo] password for abhishek:
|
||||
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
|
||||
/etc/apt/trusted.gpg
|
||||
--------------------
|
||||
pub rsa4096 2014-01-13 [SCEA] [expired: 2019-01-12]
|
||||
418A 7F2F B0E1 E6E7 EABF 6FE8 C2E7 3424 D590 97AB
|
||||
uid [ expired] packagecloud ops (production key) <[email protected]>
|
||||
|
||||
pub rsa4096 2016-02-18 [SCEA]
|
||||
DB08 5A08 CA13 B8AC B917 E0F6 D938 EC0D 0386 51BD
|
||||
uid [ unknown] https://packagecloud.io/slacktechnologies/slack (https://packagecloud.io/docs#gpg_signing) <[email protected]>
|
||||
sub rsa4096 2016-02-18 [SEA]
|
||||
|
||||
/etc/apt/trusted.gpg.d/audio-recorder-ubuntu-ppa.gpg
|
||||
----------------------------------------------------
|
||||
pub rsa4096 2015-08-30 [SC]
|
||||
42EF 41ED 9813 B713 D4F1 F06D 5CF1 2638 ACF9 669F
|
||||
uid [ unknown] Launchpad PPA for Team audio-recorder
|
||||
|
||||
/etc/apt/trusted.gpg.d/danielrichter2007-ubuntu-grub-customizer.gpg
|
||||
-------------------------------------------------------------------
|
||||
pub rsa1024 2010-10-08 [SC]
|
||||
59DA D276 B942 642B 1BBD 0EAC A8AA 1FAA 3F05 5C03
|
||||
```
|
||||
|
||||
你是怎么做的?仔细阅读该信息。
|
||||
|
||||
```
|
||||
W: https://packagecloud.io/slacktechnologies/slack/debian/dists/jessie/InRelease: Key is stored in legacy
|
||||
```
|
||||
|
||||
在我的例子中,仓库有 packagecloud、slacktechnologies 等关键词。它显示在 apt-key 列表输出的顶部。在你的情况下,你可能需要滚动一下。
|
||||
|
||||
在这种罕见的情况下,由 Slack 添加的外部仓库,有两个 GPG 密钥。其中一个已经过期,我会忽略它。你可能不会有这样的情况。
|
||||
|
||||
你应该看到 pub 后一行的最后 8 个字符(不包括空格)。
|
||||
|
||||
```
|
||||
/etc/apt/trusted.gpg
|
||||
--------------------
|
||||
pub rsa4096 2014-01-13 [SCEA] [expired: 2019-01-12]
|
||||
418A 7F2F B0E1 E6E7 EABF 6FE8 C2E7 3424 D590 97AB
|
||||
uid [ expired] packagecloud ops (production key) <[email protected]>
|
||||
|
||||
pub rsa4096 2016-02-18 [SCEA]
|
||||
DB08 5A08 CA13 B8AC B917 E0F6 D938 EC0D 0386 51BD
|
||||
uid [ unknown] https://packagecloud.io/slacktechnologies/slack (https://packagecloud.io/docs#gpg_signing) <[email protected]>
|
||||
```
|
||||
|
||||
因此,从 “DB08 5A08 CA13 B8AC B917 E0F6 D938 EC0D 0386 51BD” 这行中,我将提取最后8个字符 “0386 51BD”,去掉空格,然后用它来导入 /etc/apt/trusted.gpg.d 目录下专用文件中的 GPG 密钥:
|
||||
|
||||
```
|
||||
sudo apt-key export 038651BD | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/slack.gpg
|
||||
```
|
||||
|
||||
我在这里创建了一个新的文件 slack.gpg,以防你没有注意到它。我把它命名为 slack.gpg 是因为它与我之前安装的 Slack 应用有关。文件名并不重要,但它对识别有好处。
|
||||
|
||||
如果命令运行成功,你将不会看到任何信息。你可以通过检查新创建的 gpg 文件是否存在来验证。
|
||||
|
||||
![import gpg key to trusted ubuntu][2]
|
||||
|
||||
再次运行更新,现在你应该不会再看到警告信息了。
|
||||
|
||||
### 方法 2:复制到 trusted.gpd.d 目录中(快速而不优雅的方法)
|
||||
|
||||
如果你觉得手动做上面的事情不舒服,那么,你可以忽略这个警告信息。我的意思是,忽略它总是一种选择。
|
||||
|
||||
另一个选择是把 /etc/apt/trusted.gpg 文件复制到 /etc/apt/trusted.gpg.d 目录。毕竟,Ubuntu 只抱怨说它需要 /etc/apt/trusted.gpg.d 目录下的 GPG 密钥。
|
||||
|
||||
你仍然要使用终端。打开它并使用以下命令:
|
||||
|
||||
```
|
||||
sudo cp /etc/apt/trusted.gpg /etc/apt/trusted.gpg.d
|
||||
```
|
||||
|
||||
现在,如果你运行更新,你就不会再看到 “Key is stored in legacy trusted.gpg keyring” 的警告信息。
|
||||
|
||||
![quick dirty way to fix apt key stored legacy][3]
|
||||
|
||||
### 总结
|
||||
|
||||
我曾经写过一篇关于[apt-key 弃用][4]的详细文章。显然,那篇文章让一些读者感到困惑,因此我写了这篇文章,给他们提供摆脱该信息的直接步骤。
|
||||
|
||||
正如我之前所说,这是一个警告信息,目前可以忽略。解决这个问题的责任在于外部软件开发者和 Ubuntu 开发者。外部软件开发者应该确保他们的 GPG 密钥不再被添加到 /etc/apt/trusted.gpg 文件中。
|
||||
|
||||
终端用户不应该为他们的懒惰而承担痛苦。
|
||||
|
||||
那么,你是用哪种方法来摆脱 “key is stored in legacy” 的警告信息的呢?第一个方法还是第二个方法?
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/key-is-stored-in-legacy-trusted-gpg/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://itsfoss.com/wp-content/uploads/2022/11/ubuntu-key-is-stored-legacy.png
|
||||
[2]: https://itsfoss.com/wp-content/uploads/2022/11/import-gpg-key-to-trusted-ubuntu.png
|
||||
[3]: https://itsfoss.com/wp-content/uploads/2022/11/quick-dirty-way-to-fix-apt-key-stored-legacy.png
|
||||
[4]: https://itsfoss.com/apt-key-deprecated/
|
Loading…
Reference in New Issue
Block a user