APT Repository Issues and Fixes
Fix broken APT repositories, expired keys, and conflicting PPA problems on Ubuntu-based systems.
What This Guide Achieves
| Goal | Status |
|---|---|
| Fix duplicate repository warnings | Done |
| Resolve GPG key errors | Done |
| Clean up old .list files (legacy format) | Done |
| Understand .list vs .sources file formats | Done |
| Safely remove PPAs | Done |
The Problem (Windows User Perspective)
On Windows, software updates come from one place (Windows Update or the app itself). On Linux, software comes from repositories — external servers that apt checks for packages. When you install Chrome, Edge, Brave, or add PPAs, each one adds its own repository configuration. Over time, these can conflict, duplicate, or break — especially when repository formats changed from .list (old) to .sources (new) in Ubuntu 24.04.
Understanding the Two File Formats
Ubuntu 24.04 introduced a new repository format. Both formats work, but having both for the same repo causes problems.
Old Format: .list files
Location: /etc/apt/sources.list.d/*.list
deb [arch=amd64 signed-by=/usr/share/keyrings/google-chrome.gpg] https://dl.google.com/linux/chrome/deb/ stable main
New Format: .sources files (DEB822)
Location: /etc/apt/sources.list.d/*.sources
Types: deb
URIs: https://dl.google.com/linux/chrome/deb/
Suites: stable
Components: main
Architectures: amd64
Signed-By: /usr/share/keyrings/google-chrome.gpg
Key insight: When you install Chrome or Edge via .deb, the installer may create a .sources file. If you previously had a .list file from an older install or manual setup, you now have both — and apt update complains about duplicates.
Diagnosing Issues
Check for Duplicates
# List all repository config files
ls /etc/apt/sources.list.d/
# Look for pairs of .list and .sources for the same app
ls /etc/apt/sources.list.d/ | grep google
# Example problematic output:
# google-chrome.list
# google-chrome.sources
Check for Errors
sudo apt update 2>&1 | grep -E "W:|E:|Err"
Common error patterns:
W: Target ... is configured multiple times— duplicate reposW: ...doesn't support architecture 'i386'— missing arch restrictionErr: ... NO_PUBKEY ...— missing GPG signing key
Fix: Duplicate Repository Entries
Chrome (Most Common)
# Check what exists
ls /etc/apt/sources.list.d/ | grep google
# If BOTH google-chrome.list AND google-chrome.sources exist:
sudo rm /etc/apt/sources.list.d/google-chrome.list
# Verify
sudo apt update
Edge
ls /etc/apt/sources.list.d/ | grep microsoft-edge
# If both formats exist:
sudo rm /etc/apt/sources.list.d/microsoft-edge.list
sudo apt update
Brave
ls /etc/apt/sources.list.d/ | grep brave
# If both formats exist:
sudo rm /etc/apt/sources.list.d/brave-browser-release.list
sudo apt update
General Rule
When both .list and .sources exist for the same app:
- Keep the
.sourcesfile (new format) - Remove the
.listfile (old format) - Run
sudo apt updateto verify
Fix: Architecture Warnings (i386)
N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository '...' doesn't support architecture 'i386'
This means a 64-bit-only repository is configured without specifying arch=amd64.
For .list files:
# Edit the file
sudo nano /etc/apt/sources.list.d/google-chrome.list
# Change:
deb https://dl.google.com/linux/chrome/deb/ stable main
# To:
deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main
For .sources files:
sudo nano /etc/apt/sources.list.d/google-chrome.sources
# Add this line if missing:
Architectures: amd64
Fix: GPG Key Errors
Missing Key (NO_PUBKEY)
W: GPG error: https://dl.google.com/linux/chrome/deb stable InRelease:
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ABCDEF1234567890
Fix — import the key:
# For Chrome
curl -fsSL https://dl.google.com/linux/linux_signing_key.pub | sudo gpg --dearmor -o /usr/share/keyrings/google-chrome.gpg
# For Edge
curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor -o /usr/share/keyrings/microsoft-edge.gpg
# For Brave
curl -fsSL https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg | sudo tee /usr/share/keyrings/brave-browser-archive-keyring.gpg > /dev/null
Deprecated apt-key Warning
W: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg)
This means a key was added with the old apt-key add method. Modern Ubuntu uses per-repo keyring files in /usr/share/keyrings/.
Fix — migrate to new format:
# Export the key from legacy keyring
sudo apt-key export KEYID 2>/dev/null | sudo gpg --dearmor -o /usr/share/keyrings/repo-name.gpg
# Update the .sources or .list file to reference the new keyring:
# signed-by=/usr/share/keyrings/repo-name.gpg
Safely Removing PPAs
# List installed PPAs
grep -r "ppa" /etc/apt/sources.list.d/
# Remove a PPA and its source file
sudo add-apt-repository --remove ppa:owner/repo-name
# Clean up afterward
sudo apt update
Full PPA Removal Example (Papirus icons)
sudo apt remove --purge papirus-icon-theme papirus-folders
sudo add-apt-repository --remove ppa:papirus/papirus
sudo apt autoremove
sudo apt update
Full PPA Removal Example (FSearch)
sudo apt remove --purge fsearch
sudo add-apt-repository --remove ppa:christian-boxdoerfer/fsearch-daily
sudo apt autoremove --purge
sudo apt update
Clean State Verification
After fixing repository issues, verify everything is clean:
# Check for errors
sudo apt update 2>&1 | grep -E "W:|E:|Err"
# List all configured repos
ls /etc/apt/sources.list.d/
# Check for duplicate entries
apt-cache policy | grep -E "http" | sort | uniq -d
# Check for orphaned keys
ls /usr/share/keyrings/
What Didn’t Work (and Why)
| Approach Tried | Why It Failed |
|---|---|
Having both .list and .sources for Chrome | Causes “Target is configured multiple times” duplicate warning |
Using apt-key add to import GPG keys | Deprecated in Ubuntu 24.04 — use /usr/share/keyrings/ instead |
Not specifying [arch=amd64] in repo entry | Triggers i386 architecture warning on every apt update |
| Removing a PPA without removing its packages first | Packages remain installed but won’t get updates |
Ignoring apt update warnings | Warnings accumulate and can eventually become errors |
Related Guides
- Package Management Basics — How apt works
- Browser Setup — Chrome, Edge, Brave repository setup
- Common Issues — General troubleshooting FAQ
Discussion