How to APT

Here a small APT package tool cheet
Package Signing
Managing GPG keys in the trusted.gpg.d directory is important for package management on Debian-based systems. This directory is used to store trusted GPG keys for repositories and sources of software packages. Here's how you can manage GPG keys in the trusted.gpg.d directory:
Add a New GPG Key:
To add a new GPG key to the trusted.gpg.d directory, you can use the apt-key command. Here's the syntax:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys <key-id>
Replace <key-id> with the actual key ID you want to add. This command fetches the key from a keyserver and adds it to your trusted keys.
Remove a GPG Key:
To remove a GPG key from the trusted.gpg.d directory, you can use the apt-key del command. Here's the syntax:
sudo apt-key del <key-id>
List Trusted GPG Keys:
To list the GPG keys in the trusted.gpg.d directory, you can use the apt-key list command:
sudo apt-key list
This command will display a list of all the GPG keys currently in the trusted keys directory.
Import a GPG Key from a File:
If you have a GPG key file that you want to add to the trusted.gpg.d directory, you can use the apt-key add command. Here's the syntax:
sudo apt-key add /path/to/keyfile
Manage Repository Keys:
Often, GPG keys are associated with software repositories. To manage repository keys, you can edit the respective sources.list or sources.list.d files and add the repository along with its GPG key using the add-apt-repository command:
sudo add-apt-repository <repository-url>
This command will also fetch and add the GPG key for the specified repository.
Automated Key Management:
For automated key management and updates, you can use the debian-archive-keyring package, which contains a collection of trusted GPG keys for Debian repositories. Install it to keep your system's keys up to date:
sudo apt-get install debian-archive-keyring
This package will handle the management of GPG keys for Debian repositories.
Install older version/ Downgrade
sudo apt install package_name=package_version
apt list --all-versions package_name