• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

pacman-key Command Examples

by Deepika

“pacman-key” is a wrapper script for GnuPG (Gnu Privacy Guard), a popular encryption and signing tool, used to manage pacman’s keyring in Arch Linux and its derivatives. The pacman-key utility is used to manage the GnuPG keys that are used to authenticate packages in the pacman package manager.

Pacman uses GnuPG keys to ensure the authenticity of the packages it installs. The keys are used to sign the packages, and pacman verifies the signatures before installing a package to ensure that the package has not been tampered with and came from a trusted source.

“pacman-key” provides several options to manage the pacman keyring, including:

  • Initializing the keyring: This option generates a new keyring and sets up the necessary permissions to use GnuPG with pacman.
  • Adding keys: This option adds new GnuPG keys to the pacman keyring, allowing the user to authenticate packages from additional sources.
  • Listing keys: This option displays a list of all the GnuPG keys in the pacman keyring, along with their fingerprints and other information.
  • Deleting keys: This option allows the user to remove GnuPG keys from the pacman keyring.

pacman-key Command Examples

1. Initialize the pacman keyring:

# sudo pacman-key --init

2. Add the default Arch Linux keys:

# sudo pacman-key --populate archlinux

3. List keys from the public keyring:

# pacman-key --list-keys

4. Add the specified keys:

# sudo pacman-key --add path/to/keyfile.gpg

5. Receive a key from a key server:

# sudo pacman-key --recv-keys "uid|name|email"

6. Print the fingerprint of a specific key:

# pacman-key --finger "uid|name|email"

7. Sign an imported key locally:

# sudo pacman-key --lsign-key "uid|name|email"

8. Remove a specific key:

# sudo pacman-key --delete "uid|name|email"

Filed Under: Linux

Some more articles you might also be interested in …

  1. iotop Command Examples in Linux
  2. dvc unfreeze: Unfreeze stages in the DVC pipeline
  3. uuidgen: command not found
  4. protonvpn-cli Command Examples in Linux
  5. getcap: command not found
  6. How to test a PHP script
  7. kscreen-console Command Examples in Linux
  8. http_load Command Examples in Linux
  9. CentOS / RHEL 5 : How to disable device mapper multipath (dm-multipath)
  10. fkill: Fabulously kill processes

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright