Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
时间: 2024-05-01 07:21:07 浏览: 17
这个警告提示是因为 Ubuntu 20.04 版本开始,apt-key 工具已经被弃用,推荐使用 trusted.gpg.d 目录管理密钥环文件。因此,你可以在使用 apt-key 命令的地方,将其替换成使用 gpg 命令来添加密钥,例如:
```
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys [KEY ID]
```
可以替换为:
```
sudo gpg --keyserver keyserver.ubuntu.com --recv-keys [KEY ID]
```
同时,这个警告提示并不会影响到软件包的安装和更新。
相关问题
arning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
The warning you mentioned is related to the use of the `apt-key` command in managing keyring files for package repositories in Debian-based systems. Starting from Ubuntu 20.04 and Debian 10, the `apt-key` command has been deprecated, and it is recommended to manage keyring files in the `trusted.gpg.d` directory instead.
To address this warning, you can follow these steps:
1. Open a terminal.
2. Create a new file in the `trusted.gpg.d` directory:
```shell
sudo touch /etc/apt/trusted.gpg.d/custom.gpg
```
3. Import the GPG key using the `gpg` command:
```shell
sudo gpg --dearmor --output /etc/apt/trusted.gpg.d/custom.gpg /path/to/keyfile.gpg
```
Replace `/path/to/keyfile.gpg` with the actual path to the GPG key file you want to import.
4. Update the package lists:
```shell
sudo apt update
```
By following these steps, you should be able to manage keyring files without triggering the deprecated warning.
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)). OK
这个警告是因为在最新的 Ubuntu 版本中,apt-key 命令已经被弃用,建议使用 trusted.gpg.d 目录来管理密钥。你可以忽略这个警告,不影响软件的正常安装和使用。如果你想避免这个警告,可以尝试使用新的命令来添加密钥,例如:
```
curl -sSL https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x<key-id> | sudo tee /etc/apt/trusted.gpg.d/<key-name>.gpg
```
其中 `<key-id>` 是密钥的 ID,`<key-name>` 是你给密钥起的名字。你可以在安装软件时,根据需要添加相应的密钥。