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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • 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. How to Make User Account Read-Only in CentOS/RHEL 7
  2. pdbedit Command Examples in Linux
  3. ‘nestat -s’ showing a large number for “packet reassembles failed” errors in CentOS/RHEL
  4. larasail Command Examples in Linux
  5. lvm: command not found
  6. How to Remove Network Printer in CentOS/RHEL
  7. How to Change Time Interval to Fall Back to Secondary DNS Server in CentOS/RHEL
  8. ufw Command Examples in Linux
  9. adduser Command Examples in Linux
  10. How to Find Number of CPU Sockets on a CentOS/RHEL System

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright