Proxmox APT Update Errors: Fix GPG, Repository, and dpkg Issues
Resolve common Proxmox VE apt update errors including GPG NO_PUBKEY, 401 enterprise repo without subscription, InRelease hash mismatch, dpkg lock, and sources.list fixes.
Why APT Updates Fail on Proxmox
Keeping Proxmox VE updated is critical for security and stability, but repository configuration issues can make apt update fail with confusing error messages. Most of these errors are related to repository authentication, subscription status, or network problems. This guide covers each common error and its fix.
Error: GPG NO_PUBKEY
This error means APT cannot verify the repository's signature because the GPG key is missing or expired.
# Typical error message:
# W: GPG error: http://download.proxmox.com/debian/pve bookworm InRelease:
# The following signatures couldn't be verified because the public key
# is not available: NO_PUBKEY AABBCCDD11223344
# Fix: download and install the missing key
wget https://enterprise.proxmox.com/debian/proxmox-release-bookworm.gpg \
-O /etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg
# Verify the key was installed
apt-key list 2>/dev/null | grep proxmox
# Or for newer apt:
ls -la /etc/apt/trusted.gpg.d/proxmox*
# If the key ID is different, add it directly
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AABBCCDD11223344
# Then retry
apt update
Error: 401 Unauthorized (Enterprise Repo Without Subscription)
This is the most common Proxmox repository error. The enterprise repository requires a valid Proxmox subscription. Without one, every apt update will fail with a 401 error.
# Typical error:
# E: Failed to fetch https://enterprise.proxmox.com/debian/pve/dists/bookworm/InRelease
# 401 Unauthorized
# Check your current repository configuration
cat /etc/apt/sources.list
ls /etc/apt/sources.list.d/
cat /etc/apt/sources.list.d/pve-enterprise.list
# Option 1: If you have a subscription, register it
pvesubscription set YOUR-KEY-HERE
# Option 2: Disable the enterprise repo and enable the no-subscription repo
# Disable enterprise repo
echo "# deb https://enterprise.proxmox.com/debian/pve bookworm pve-enterprise" \
> /etc/apt/sources.list.d/pve-enterprise.list
# Enable no-subscription repository
echo "deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription" \
> /etc/apt/sources.list.d/pve-no-subscription.list
# Update
apt update
The no-subscription repository is suitable for testing and home lab use. For production environments, Proxmox recommends purchasing a subscription to access the enterprise repository, which receives more thorough testing.
Error: InRelease Hash Mismatch
Hash mismatch errors indicate that the repository metadata was corrupted during download, often due to a caching proxy, CDN issue, or interrupted download.
# Typical error:
# E: Failed to fetch http://download.proxmox.com/.../InRelease
# Hash Sum mismatch
# Fix 1: Clear the APT cache and retry
apt clean
rm -rf /var/lib/apt/lists/*
apt update
# Fix 2: If you use a proxy, bypass it temporarily
# In /etc/apt/apt.conf.d/proxy.conf, comment out proxy settings
# Then:
apt update
# Fix 3: If the issue is intermittent, just retry
# CDN propagation delays can cause temporary mismatches
apt update
# Fix 4: Force IPv4 if IPv6 is causing issues
echo 'Acquire::ForceIPv4 "true";' > /etc/apt/apt.conf.d/99force-ipv4
apt update
Error: dpkg Lock
This error occurs when another package management process is already running, or when a previous operation crashed and left a lock file behind.
# Typical error:
# E: Could not get lock /var/lib/dpkg/lock-frontend
# E: Unable to acquire the dpkg frontend lock
# Check what process holds the lock
lsof /var/lib/dpkg/lock-frontend
fuser /var/lib/dpkg/lock-frontend
# Check for running apt/dpkg processes
ps aux | grep -E "apt|dpkg"
# If a legitimate process is running, wait for it to finish
# Common culprits:
# - unattended-upgrades running in the background
# - Another terminal session running apt
# If the process is stuck or dead, remove the locks
# ONLY do this if no apt/dpkg process is actually running
rm /var/lib/dpkg/lock-frontend
rm /var/lib/dpkg/lock
rm /var/cache/apt/archives/lock
# Then reconfigure any interrupted packages
dpkg --configure -a
# Retry
apt update
Fixing sources.list Configuration
A properly configured Proxmox sources.list setup is essential. Here is a reference configuration for Proxmox VE on Debian Bookworm without a subscription.
# /etc/apt/sources.list - Base Debian repositories
deb http://deb.debian.org/debian bookworm main contrib non-free-firmware
deb http://deb.debian.org/debian bookworm-updates main contrib non-free-firmware
deb http://security.debian.org/debian-security bookworm-security main contrib non-free-firmware
# /etc/apt/sources.list.d/pve-no-subscription.list
deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription
# /etc/apt/sources.list.d/pve-enterprise.list (commented out)
# deb https://enterprise.proxmox.com/debian/pve bookworm pve-enterprise
# If using Ceph, add the Ceph repository:
# /etc/apt/sources.list.d/ceph.list
# deb http://download.proxmox.com/debian/ceph-reef bookworm no-subscription
After Fixing Repository Issues
Once your repositories are correctly configured, perform a full update.
# Update package lists
apt update
# Check for available upgrades
apt list --upgradable
# Perform the upgrade
apt full-upgrade
# If upgrading Proxmox kernel, reboot after
# Check if a reboot is needed
ls /var/run/reboot-required 2>/dev/null && echo "Reboot required"
# Verify Proxmox version after update
pveversion -v
Preventing Future Update Issues
Set up a routine to catch update problems early. If you manage multiple Proxmox nodes, ProxmoxR can help you track which nodes are up to date and which have pending updates.
# Create a simple update check script
#!/bin/bash
apt update 2>&1 | grep -E "Err:|W:|E:" > /tmp/apt-errors.txt
if [ -s /tmp/apt-errors.txt ]; then
echo "APT update issues detected:"
cat /tmp/apt-errors.txt
exit 1
fi
echo "APT repositories are healthy"
# Schedule it to run daily
# In /etc/cron.daily/check-apt:
# chmod +x /etc/cron.daily/check-apt
Repository issues are usually quick to fix once you identify the specific error. The most common scenario is the 401 enterprise error on systems without a subscription. Get your sources.list right, keep your GPG keys current, and your updates will run smoothly.
Take Proxmox management mobile
All the features discussed in this guide — accessible from your phone with ProxmoxR. Real-time monitoring, power control, firewall management, and more.