How to fix apt-get: relocation error: /usr/lib/x86_64-linux-gnu/libapt-pkg.so.6.0: symbol _ZN3apt3deb5HeaderC1EPKc version APTPKG_6.0 not defined in file libapt-pkg.so.6.0 with link time reference in APT

APTADVANCEDHIGHUpdated Dec 29, 2025· 322 views

This relocation error occurs when your apt package manager has library version mismatches, typically caused by mixing packages from different distributions or incomplete upgrades. The fix involves reinstalling apt and libapt-pkg packages to restore compatibility.

Quick fix

Fixes apt-get: relocation error: /usr/lib/x86_64-linux-gnu/libapt-pkg.so.6.0: symbol _ZN3apt3deb5HeaderC1EPKc version APTPKG_6.0 not defined in file libapt-pkg.so.6.0 with link time reference

cat /etc/apt/sources.list
ls -la /etc/apt/sources.list.d/
  1. Identify conflicting repositories and clean sources
  2. Fix broken packages with dpkg
  3. Reinstall apt and libapt-pkg packages
  4. Use auto-deconfigure if dpkg conflicts arise
apt — error
cat /etc/apt/sources.list
ls -la /etc/apt/sources.list.d/
apt-get: relocation error: /usr/lib/x86_64-linux-gnu/libapt-pkg.so.6.0: symbol _ZN3apt3deb5HeaderC1EPKc version APTPKG_6.0 not defined in file libapt-pkg.so.6.0 with link time reference

What this error means

The relocation error happens when the apt binary cannot find or properly load the libapt-pkg library it depends on. This indicates a symbol version mismatch—the apt executable was built against a different version of libapt-pkg than what's currently installed on your system. This commonly occurs after: - A partial or interrupted system upgrade - Mixing packages from different Ubuntu/Debian versions (e.g., Focal and Jammy) - Installing third-party PPAs that provide incompatible package versions - Manual package manipulation or downgrades that left the system inconsistent The error appears because GCC changed symbol mangling in version 7+, and when apt and libapt-pkg versions don't match, the binary cannot find the expected library symbols at runtime.

Typical symptoms

  • apt-get: relocation error when running any apt command
  • Unable to run 'apt-get update', 'apt-get install', or 'apt install'
  • Update manager or Software Center fails to open
  • System cannot perform any package management operations
  • apt or aptitude completely non-functional
  • Cannot even run 'apt --version' to check the version

Common causes

  1. Mixing packages from multiple Debian/Ubuntu releases in sources.list
  2. Partial or interrupted system upgrade leaving packages inconsistent
  3. Installing from incompatible PPAs without proper dependency management
  4. Manual downgrade of apt or libapt-pkg packages
  5. Corrupted package installation or extraction
  6. Stale package cache with mismatched library versions
  7. System upgrade that changed GCC ABI without recompiling all packages

How to fix "apt-get: relocation error: /usr/lib/x86_64-linux-gnu/libapt-pkg.so.6.0: symbol _ZN3apt3deb5HeaderC1EPKc version APTPKG_6.0 not defined in file libapt-pkg.so.6.0 with link time reference"

1Identify conflicting repositories and clean sources

First, check which repositories are enabled and look for anything from non-standard sources:

bash
cat /etc/apt/sources.list
ls -la /etc/apt/sources.list.d/

Look for any PPAs or third-party repositories that might provide their own apt packages. If you find suspicious entries, disable them:

bash
# Comment out problematic lines in /etc/apt/sources.list
sudo nano /etc/apt/sources.list

# Or remove third-party repo files
sudo rm /etc/apt/sources.list.d/problematic-repo.list

Only keep the official Ubuntu or Debian repositories for your release.

2Fix broken packages with dpkg

Attempt to repair broken packages using dpkg. This can work even when apt is broken:

bash
sudo dpkg --configure -a

This tells dpkg to complete any partial installations. If this succeeds, try:

bash
sudo apt --fix-broken install

If apt still doesn't work, proceed to the next step.

3Reinstall apt and libapt-pkg packages

If dpkg alone doesn't fix it, manually reinstall the apt packages. First, try to download the package files from the Ubuntu/Debian mirror:

For Ubuntu/Debian online systems:

bash
# Try to download and install directly
sudo apt-get install --reinstall apt libapt-pkg6.0

If that fails (because apt doesn't work), use dpkg directly:

bash
# Check your system's release
lsb_release -cs

Then download the matching packages from https://packages.ubuntu.com or https://packages.debian.org and install with dpkg:

bash
# Example for Ubuntu 22.04 (jammy)
cd /tmp
wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/apt_2.4.14_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/libapt-pkg6.0_2.4.14_amd64.deb

# Install using dpkg
sudo dpkg -i ./apt_2.4.14_amd64.deb ./libapt-pkg6.0_2.4.14_amd64.deb

Replace the version numbers and URLs with those appropriate for your distribution release.

4Use auto-deconfigure if dpkg conflicts arise

If dpkg reports conflicts during installation, use the auto-deconfigure flag:

bash
sudo dpkg -i --auto-deconfigure apt_*.deb libapt-pkg6.0_*.deb

This tells dpkg to automatically deconfigure conflicting packages first, then install the new versions. This can help resolve dependency entanglement.

5Remove incompatible PPAs permanently

If your system was corrupted by a problematic PPA, prevent it from causing issues again:

bash
# If the PPA package is still installed
sudo apt-get remove ppa-purge
sudo ppa-purge ppa:problematic/repo

# Or manually remove the repo
sudo rm /etc/apt/sources.list.d/problematic-repo.list

# Clean APT cache
sudo apt-get clean
sudo apt-get autoclean

After cleaning, verify your sources list contains only official repositories:

bash
cat /etc/apt/sources.list
ls /etc/apt/sources.list.d/

Then try apt again:

bash
sudo apt-get update
6Perform a full system upgrade if successful

Once apt is working again, bring your system fully up to date:

bash
sudo apt-get update
sudo apt-get upgrade

If you want a more aggressive upgrade (useful after fixing from a corrupted state):

bash
sudo apt-get dist-upgrade

This ensures all packages are at compatible versions. After the upgrade, verify everything works:

bash
apt --version
apt-cache search test
sudo apt-get install --dry-run vim  # Test without installing
7Boot from live USB if apt is completely broken

If none of the above works and your system is unbootable, use a live USB:

1. Download Ubuntu or Debian live ISO matching your original release
2. Boot from USB: insert USB and restart, then select boot from USB
3. Once in the live environment, open a terminal

4. Mount your root filesystem:

bash
sudo mount /dev/sdXX /mnt  # Replace sdXX with your root partition
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo mount --bind /dev /mnt/dev

5. Chroot into your system:

bash
sudo chroot /mnt /bin/bash

6. Once inside, repeat steps 1-5 from this guide:

bash
dpkg --configure -a
apt --fix-broken install
apt-get install --reinstall apt libapt-pkg6.0

7. Exit chroot and reboot:

bash
exit
sudo reboot

This approach works when your main system cannot boot due to apt corruption.

Advanced notes

Understanding symbol versioning in Linux:
When a C++ library is built, symbols are created with version information (SONAME). The apt binary is linked against a specific SONAME version (e.g., APTPKG_6.0). If the installed libapt-pkg.so.6.0 was built with a different compiler or from a different source, it may not have the expected symbols, causing the relocation error.

GCC ABI breaking changes:
GCC 7 changed the C++ ABI, which broke compatibility between libraries compiled with GCC 6 and GCC 7+. This is one common cause of symbol version mismatches when mixing packages from different distributions.

Why mixing distributions breaks apt:
Each Debian/Ubuntu release pins specific versions of apt and libapt-pkg to work together. When you mix sources.list entries from Jammy and Focal (for example), you might get a newer apt with an older libapt-pkg, causing exactly this error. APT itself is designed to manage package versions, but it cannot reconcile itself if it's already broken.

Safe recovery without network access:
If your system has no internet access, you can:
1. Copy package files (.deb) from a working machine with the same OS version
2. Use 'apt-offline' tool on a working system to download dependencies
3. Create a local repository on USB and install from it

Prevention:
- Stick to ONE Ubuntu/Debian release per system
- Use official repositories only, or vet PPAs carefully
- Never mix sources.list entries from different releases
- Regularly run apt-get update && apt-get upgrade to keep packages consistent
- Avoid manual package downgrading

Checking library compatibility:
After recovering apt, verify your libraries are consistent:

bash
ldd /usr/bin/apt
ldd /usr/lib/x86_64-linux-gnu/libapt-pkg.so.6.0

All dependencies should resolve to libraries from the same release.

Frequently asked questions

What does "apt-get: relocation error: /usr/lib/x86_64-linux-gnu/libapt-pkg.so.6.0" mean?
The relocation error happens when the apt binary cannot find or properly load the libapt-pkg library it depends on. This indicates a symbol version mismatch—the apt executable was built against a different version of libapt-pkg than what's currently installed on your system. , Focal and Jammy) - Installing third-party PPAs that provide incompatible package versions - Manual package manipulation or downgrades that left the system inconsistent The error appears because GCC changed symbol mangling in version 7+, and when apt and libapt-pkg versions don't match, the binary cannot find the expected library symbols at runtime.
How do I fix "apt-get: relocation error: /usr/lib/x86_64-linux-gnu/libapt-pkg.so.6.0"?
This relocation error occurs when your apt package manager has library version mismatches, typically caused by mixing packages from different distributions or incomplete upgrades. The fix involves reinstalling apt and libapt-pkg packages to restore compatibility.
What causes "apt-get: relocation error: /usr/lib/x86_64-linux-gnu/libapt-pkg.so.6.0"?
Mixing packages from multiple Debian/Ubuntu releases in sources.list Partial or interrupted system upgrade leaving packages inconsistent Installing from incompatible PPAs without proper dependency management
Is the "apt-get: relocation error: /usr/lib/x86_64-linux-gnu/libapt-pkg.so.6.0" error serious?
Yes. This is a high-severity error that usually blocks work until it is fixed, but the steps above resolve it.

Official resources & further reading