Study guide
4.5 Package Repositories & Integrity Verification (102.4/102.5)
LPIC-1 Linux Administrator — Exam 101 101-500
Track your progress as you read
Finished sections get a check mark.
1 Exam Overview & Study Strategy
1.1 LPIC-1 101-500 Exam Structure & Blueprint 1.2 Command Line & Shell Fundamentals for Exam Success 1.3 Fill-in-the-Blank Strategies & Common Traps
2 Topic 101: System Architecture
2.1 Hardware Discovery, Sysfs, Procfs & Kernel Modules (101.1) 2.2 Udev, Dbus & Device Management (101.1) 2.3 BIOS vs. UEFI & System Boot Process (101.2) 2.4 Kernel Initialization, Initramfs & System Logs (101.2) 2.5 Systemd Boot Targets & Unit Management (101.3) 2.6 SysVinit Runlevels, Telinit & System Shutdown (101.3)
3 Topic 102: Linux Installation & Boot Management
3.1 Hard Disk Layout, Partition Schemes & Swap Design (102.1) 3.2 LVM & Standard Mount Point Allocation (102.1) 3.3 GRUB 2 Configuration & Troubleshooting (102.2) 3.4 Legacy GRUB & Alternative Boot Loaders (102.2) 3.5 Managing Shared Libraries & ldconfig (102.3) 3.6 Linux as a Virtualization Guest & Cloud Instances (102.6)
4 Topic 102: Package Management Systems
4.1 Debian Low-Level Package Management with dpkg (102.4) 4.2 High-Level Debian Package Management: apt, apt-get & apt-cache (102.4) 4.3 RPM Package Management with rpm (102.5) 4.4 YUM, DNF & Zypper Package Management (102.5) 4.5 Package Repositories & Integrity Verification (102.4/102.5) 4.6 Universal Linux Packages: Snap, Flatpak & AppImage (102.4/102.5)
5 Topic 103: Command Line & Text Processing
5.1 Shell Environment, Environment Variables & Aliases (103.1) 5.2 Command History, Quoting & Expansion (103.1) 5.3 Basic Text Filters: cat, head, tail, cut, paste, nl, od (103.2) 5.4 Advanced Text Filters: sort, uniq, wc, tr, split, less & Checksums (103.2) 5.5 Stream Editing with sed (103.2) 5.6 Basic File Management: cp, mv, rm, touch, mkdir, rmdir (103.3) 5.7 Archiving and Compression: tar, gzip, bzip2, xz, cpio & dd (103.3)
6 Topic 103: Streams, Processes, Regex & Vi
6.1 Standard Streams, Redirection & File Descriptors (103.4) 6.2 Pipelines, tee & xargs (103.4) 6.3 Process Monitoring: ps, top, free, watch, pgrep, pstree & uptime (103.5) 6.4 Signals, kill, Job Control, nohup, screen & tmux (103.5) 6.5 Process Priorities: nice & renice (103.6) 6.6 Regular Expressions & grep, egrep, fgrep (103.7) 6.7 vi / vim Modes, plus nano, Emacs & EDITOR Awareness (103.8)
7 Topic 104: Devices, Partitions & Filesystems
7.1 Block Devices, fdisk & gdisk (104.1) 7.2 GNU Parted & Partition Table Management (104.1) 7.3 Creating Filesystems: mkfs, ext4, XFS, VFAT/exFAT & Btrfs (104.1) 7.4 Filesystem Integrity: fsck, e2fsck, xfs_repair, xfs_fsr & xfs_db (104.2) 7.5 Monitoring Disk Usage: df, du & tune2fs (104.2) 7.6 Managing Swap Space: mkswap, swapon & swapoff (104.1/104.2)
8 Topic 104: Mounts, Permissions, Links & FHS
8.1 Mounting and Unmounting Filesystems: mount & umount (104.3) 8.2 Persistent Mounts: /etc/fstab, UUIDs & systemd mount units (104.3) 8.3 Standard File Permissions: chmod, chown, chgrp & umask (104.5) 8.4 Special Permissions: SUID, SGID & Sticky Bit (104.5) 8.5 Hard Links vs. Symbolic Links: ln & Inodes (104.6) 8.6 Filesystem Hierarchy Standard (FHS) & File Location (104.7)
4.5 Package Repositories & Integrity Verification (102.4/102.5)
Key Takeaways Explain This Topic AI
Debian repository lines in /etc/apt/sources.list define archive type (deb/deb-src), URI, distribution suite, and component sections (main, contrib, non-free, non-free-firmware).
Modern Debian systems isolate repository GPG keys into /usr/share/keyrings/ or /etc/apt/keyrings/ using the signed-by option, replacing the deprecated global apt-key utility.
RPM repository configuration files reside in /etc/yum.repos.d/*.repo and utilize directives including name, baseurl, mirrorlist, enabled, gpgcheck, and gpgkey.
GPG public keys are imported into the RPM database using rpm --import and registered as gpg-pubkey pseudo-packages.
The integrity and cryptographic signatures of uninstalled RPM packages are verified using rpm -K (or rpm --checksig).
Last updated: August 2026
4.5 Package Repositories & Integrity Verification (102.4/102.5)
Quick Summary: Software repositories are centralized network storage locations containing binary packages, source code, and cryptographically signed metadata indexes. To ensure supply chain security, both Debian and Red Hat ecosystems implement asymmetric GPG (GNU Privacy Guard) public-key cryptography. This architecture ensures that package managers download software only from authentic origin servers and guarantees that packages have not been tampered with or corrupted in transit.
1. Debian Repository Configuration ( sources.list )
In Debian, Ubuntu, and derivative distributions, repository locations are defined in /etc/apt/sources.list and modular files ending in .list under /etc/apt/sources.list.d/ . deb [arch=amd64 signed-by=...] http://deb.debian.org/debian/ bookworm main contrib non-free
- └──┬┘ └────────────┬───────────┘ └──────────────┬──────────────┘ └───┬────┘ └──────────┬───────────┘
- Type Options URI Suite Components
- Debian Repository Line Structure
Archive Type ( type ) :
deb : Indicates a repository providing compiled binary .deb packages.
deb-src : Indicates a repository providing Debian source packages ( .dsc , .orig.tar.gz , .diff.gz ).
Options ( [options] ) : Optional bracketed parameters (e.g., [arch=amd64] , [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] ).
URI ( uri ) : The base URL, FTP address, or local path ( file:/... ) of the repository.
Distribution Suite / Codename ( distribution ) : The target release suite (e.g., stable , testing , unstable ) or release codename (e.g., bookworm , bullseye , jammy ).
Components ( components ) : Software classification sections categorized by licensing and support:
main : 100% DFSG-compliant (Debian Free Software Guidelines) software that requires no non-free dependencies.
contrib : DFSG-compliant open-source software that depends on proprietary or non-free packages.
non-free : Proprietary software or software containing licensing restrictions.
non-free-firmware : Introduced in Debian 12 (Bookworm) to isolate closed-source binary firmware blobs for network and GPU hardware. # Sample /etc/apt/sources.list for Debian 12 Bookworm
- deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
- deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
- deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
- 2. Debian Cryptographic Verification & Modern Keyrings
Debian package integrity relies on a cryptographic chain of trust:
The repository maintains a Release metadata file listing SHA256 checksums for all Packages.gz index files.
The repository signs the Release file with a private GPG key, generating an InRelease or Release.gpg detached signature.
APT downloads the signature, validates it against the trusted local public GPG keyring, and verifies that individual downloaded .deb files match the SHA256 digests in Packages.gz .
The Deprecation of apt-key & Modern Best Practices
Historically, administrators added repository signing keys using apt-key add key.gpg . This practice is deprecated because apt-key placed all keys into a single global keyring ( /etc/apt/trusted.gpg ), allowing a compromised key from a third-party repository to sign packages for official core system repositories.
Modern Keyring Standard:
GPG public keys are stored as isolated binary keyring files under /usr/share/keyrings/ or /etc/apt/keyrings/ .
The repository line in sources.list explicitly references its specific key using the signed-by option: # 1. Download and de-armor the GPG key into an isolated keyring file
curl -fsSL https://packages.example.com/gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/example-keyring.gpg > /dev/null
# 2. Reference the isolated keyring in /etc/apt/sources.list.d/example.list
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/example-keyring.gpg] https://packages.example.com/deb stable main" | sudo tee /etc/apt/sources.list.d/example.list
3. RPM Repository Configuration ( .repo Files)
In RHEL, CentOS, Fedora, and openSUSE, repository definitions reside in /etc/yum.repos.d/ as individual files ending in .repo . Each file uses standard INI syntax containing one or more repository sections. [baseos]
- name=Rocky Linux $releasever - BaseOS
- baseurl=http://dl.rockylinux.org/pub/rocky/$releasever/BaseOS/$basearch/os/
- # mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=BaseOS-$releasever
- enabled=1
- gpgcheck=1
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9
- priority=1
- Core Directives in .repo Files
Directive Data Type / Values Description
[repo-id] String (bracketed) Unique internal identifier for the repository (must contain no spaces).
name= String Human-readable description of the repository.
baseurl= URL (HTTP/HTTPS/FTP/File) Direct URL pointing to the directory containing the repository's repodata/ directory.
mirrorlist= URL URL that dynamically generates a list of active mirror baseurl mirrors based on geographic location.
enabled= 1 or 0 1 enables the repository for package transactions; 0 disables it.
gpgcheck= 1 or 0 1 forces RPM/DNF to verify GPG signatures on downloaded RPM packages before installation.
repo_gpgcheck= 1 or 0 1 verifies the cryptographic signature of the repository metadata itself ( repomd.xml.asc ).
gpgkey= URL / File Path Location of the GPG public key used to verify package signatures (e.g., file:///etc/pki/rpm-gpg/... ).
Variable Expansion in .repo Files
$releasever : Replaced by the OS major/minor release version (e.g., 9 ).
$basearch : Replaced by the system base CPU architecture (e.g., x86_64 , aarch64 ).
$arch : Replaced by the exact CPU architecture (e.g., i686 ).
4. RPM Key Management & Package Signature Checking
RPM stores imported GPG public keys in its internal database ( /var/lib/rpm/ ) formatted as pseudo-packages named gpg-pubkey . # Import an official vendor GPG public key into the RPM database
- $ sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9
- # OR import directly over HTTPS
- $ sudo rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-9
- # Query all imported GPG public keys
- $ rpm -qa "gpg-pubkey*"
- gpg-pubkey-350d275d-62423f66
- gpg-pubkey-8483c65d-5ccc5b19
- # Inspect metadata and fingerprint of an imported key
- $ rpm -qi gpg-pubkey-350d275d-62423f66
- Package Integrity & Signature Verification with rpm -K
The rpm -K (or rpm --checksig ) command checks the cryptographic signature and digest hashes of an uninstalled .rpm package file before allowing installation. # Verify cryptographic signatures and SHA256 digests
- $ rpm -K httpd-2.4.51-1.el9.x86_64.rpm
- httpd-2.4.51-1.el9.x86_64.rpm: digests signatures OK
- # Check only digests while skipping GPG signature verification
- $ rpm -K --nogpg httpd-2.4.51-1.el9.x86_64.rpm
- # Check only GPG signatures while skipping checksum digests
- $ rpm -K --nodigest httpd-2.4.51-1.el9.x86_64.rpm
💡 LPIC-1 Exam Fill-in-the-Blank Alert: When asked for the command and flag to import a GPG public key into the RPM database, the answer is rpm --import <key_file> .
When asked for the command to check the cryptographic signature of an RPM archive file, the answer is rpm -K <file.rpm> (or rpm --checksig ).