arning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
时间: 2023-09-28 21:13:35 浏览: 306
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.
阅读全文