Parrot Linux apt Errors: Fix Broken Packages and Held Dependencies

A Parrot Linux apt error almost always falls into one of a handful of patterns: a dependency that cannot be satisfied, a package that is “held” at an old version, a lock file left behind by another process, or a repository that no longer matches what apt expects. The scary part is that the messages look similar even when the causes are completely different. This guide walks through the errors you are most likely to meet on Parrot OS, explains what each one actually means, and gives you a repeatable order of operations so you fix the real problem instead of running random commands from a forum thread.

Everything here applies to Parrot 7.x (Debian 13 base). The commands are standard Debian tooling plus Parrot’s own parrot-upgrade wrapper, so they will also help if you are working on a slightly older install.

Start Here: The Safe Diagnostic Sequence

Before you fix anything, collect the facts. Run these in order and read the output carefully; most of the time the first or second command already tells you what went wrong.

sudo apt update
sudo apt --fix-broken install
sudo dpkg --configure -a
apt-mark showhold
apt policy

Here is what each step is for:

  • apt update refreshes the package lists. If this step fails, your problem is with repositories, mirrors or keys, not with installed packages. Jump to the repository section below.
  • apt --fix-broken install (the long form of apt -f install) asks apt to resolve any half-installed or unsatisfied dependency state. It is safe to run and often fixes the issue outright.
  • dpkg --configure -a finishes configuring packages that were unpacked but never set up, which is common after an interrupted upgrade.
  • apt-mark showhold lists packages pinned to their current version. An empty result means holds are not your problem.
  • apt policy shows which repositories are active and their priorities, so you can spot a stray third-party source.

If you have not upgraded Parrot in a while, also read how to update Parrot Linux safely; half of the apt problems people report come from mixing apt upgrade, apt full-upgrade and parrot-upgrade in ways the system was not designed for.

Parrot Linux apt Error: “Could not get lock /var/lib/dpkg/lock-frontend”

This is the most common message new users see, and it is rarely a real fault. It means another process already holds the package database. On a fresh desktop login that is usually an automatic update check or the graphical package tool. Wait a minute and retry. If the message persists, find the holder:

sudo lsof /var/lib/dpkg/lock-frontend
sudo lsof /var/lib/apt/lists/lock

If a process is listed and it is a legitimate updater, let it finish. If the process is dead (for example, your terminal crashed mid-upgrade) and lsof shows nothing, you can remove the stale locks:

sudo rm /var/lib/dpkg/lock-frontend /var/lib/dpkg/lock
sudo rm /var/lib/apt/lists/lock /var/cache/apt/archives/lock
sudo dpkg --configure -a

Only delete lock files when you are sure nothing is running. Killing a live dpkg process is one of the few ways to put the package database into a state that needs manual repair.

“Unmet dependencies” and “Packages have been kept back”

These two messages have different severities, so do not treat them the same way.

Packages have been kept back

This is informational, not an error. apt upgrade refuses to install anything that would require removing another package or pulling in brand-new ones. Parrot’s kernel and tool metapackages trigger this regularly because a new kernel version is technically a new package name. The fix is to use the full upgrade path:

sudo parrot-upgrade

or, if you prefer the Debian command underneath it:

sudo apt full-upgrade

Read the proposed removals before confirming. On Parrot the list is normally just old kernel packages; if it suddenly wants to remove your desktop environment, cancel and investigate (see the mixed-sources section).

Unmet dependencies

This one is a real problem. Apt is telling you that package A needs version X of package B, and version X is not available from any enabled repository. Typical output looks like:

The following packages have unmet dependencies:
 some-tool : Depends: libfoo1 (>= 2.1) but 2.0-3 is to be installed

Work through these causes in order:

  1. Stale package lists. Run sudo apt update again; a mirror that was mid-sync when you last refreshed can serve inconsistent lists.
  2. A held package. If apt-mark showhold lists libfoo1, the hold is blocking the newer version. Release it with sudo apt-mark unhold libfoo1.
  3. A foreign repository. If you added a Debian, Ubuntu or Kali source “to get one tool”, that repository can offer package versions that conflict with Parrot’s. Check apt policy libfoo1: the version it wants to install should come from a deb.parrot.sh mirror, not somewhere else.
  4. A manually installed .deb. A package you installed with dpkg -i may declare dependencies the repository cannot meet. Remove it with sudo apt remove package-name and find a Parrot or Flatpak alternative.

When you cannot find the cause, let apt show you its reasoning instead of guessing:

sudo apt install -o Debug::pkgProblemResolver=yes some-tool

The output is verbose, but the lines beginning with “Investigating” and “Broken” tell you exactly which package relationship apt cannot satisfy.

Held Packages: Finding and Releasing Them

A hold tells apt to never change a package’s version, even during full-upgrade. People set holds deliberately (for example, to keep a kernel that works with a finicky Wi-Fi card) and then forget. Some graphical tools also set holds silently when you choose “lock version”.

# list all holds
apt-mark showhold

# release one package
sudo apt-mark unhold linux-image-amd64

# release everything that is held
apt-mark showhold | xargs sudo apt-mark unhold

After releasing holds, run sudo apt update && sudo parrot-upgrade and let the pending versions come through. If you really need to keep a specific version, the cleaner approach is apt-mark hold on exactly one package with a comment in your own notes about why, so future-you knows what to undo.

Holds are also a legitimate tool when a kernel update breaks boot. If that is your situation, the kernel rollback and recovery guide covers how to boot the previous kernel first and then decide whether a temporary hold makes sense.

Broken Packages After an Interrupted Upgrade

A power cut, a closed laptop lid or a crashed terminal in the middle of parrot-upgrade leaves packages in an “unpacked” or “half-configured” state. The symptom is usually that every apt command, even apt install of something unrelated, ends with a message about packages that need to be reinstalled or configured first.

The repair sequence is:

sudo dpkg --configure -a
sudo apt --fix-broken install
sudo apt clean
sudo apt update
sudo parrot-upgrade

If dpkg --configure -a fails on one specific package and reports a script error, look at the exact script that failed. The message names it, for example post-installation script subprocess returned error exit status 1. You can see what the script does with:

sudo cat /var/lib/dpkg/info/package-name.postinst

Often the script fails because a service could not start or a directory did not exist. Fix that underlying condition (start the service manually, create the directory) and rerun dpkg --configure -a. Reinstalling the package itself is the next step:

sudo apt install --reinstall package-name

Repository and Key Errors

If sudo apt update itself fails, nothing downstream can work. The three messages worth knowing are:

MessageMeaningFix
Failed to fetch … 404 Not FoundThe mirror does not have the file; often a mirror that is out of date or a repository line for a release that no longer exists.Switch mirrors or correct the sources line.
NO_PUBKEY / signatures couldn’t be verifiedApt cannot verify the repository signature. Common when a third-party key expired or was added the old, deprecated way.Re-add the key properly, or remove the third-party source.
Release file is not valid yet / expiredYour system clock is wrong, or the mirror is stale.Fix the clock (timedatectl), then try another mirror.

The authoritative place to check your repository lines is /etc/apt/sources.list.d/parrot.list. It should reference a Parrot mirror and the current release codename, with nothing else mixed in. If downloads are merely slow rather than failing, the mirror change guide explains how to pick a faster one. Keep in mind that the Parrot mirror list on the mirrors network page is the safe source of candidates; do not copy random mirror URLs from old blog posts.

For key errors from a third-party source, the modern Debian method is to store the key in /etc/apt/keyrings/ and reference it with signed-by= in the source line. The old apt-key add command is deprecated on Debian 13 and will produce warnings even when it works. The exact instructions depend on the repository; the vendor’s own site usually documents them, and the Debian wiki’s third-party repository page describes the general pattern.

The Mixed-Sources Trap: Debian, Ubuntu and Kali Repositories

This deserves its own warning because it is the single most common way people permanently break a Parrot install. Parrot already tracks Debian, so adding a plain Debian repository usually does nothing useful but can introduce version skew. Adding Ubuntu PPAs is worse: Ubuntu packages are built against different library versions and will pull in replacements for core libraries. Adding the Kali repository to “get more tools” is the worst case of all, because Kali and Parrot both ship patched versions of the same metapackages and apt will happily try to merge them.

Signs you have fallen into this trap:

  • apt full-upgrade wants to remove dozens of packages, including the desktop or parrot-core.
  • apt policy shows a non-Parrot source with a priority of 500 or higher.
  • Packages report versions that do not match what Parrot’s repository offers.

Recovery, if you catch it before upgrading: remove the foreign source file from /etc/apt/sources.list.d/, run sudo apt update, and check apt policy again. If you already upgraded against mixed sources, downgrading every affected package is tedious and error-prone; a clean reinstall with your home directory backed up is usually faster.

Disk Space and Cache Problems

An apt error that mentions No space left on device or a failed write to /var/cache/apt/archives means the partition holding /var is full. Check with:

df -h /var /boot /
sudo du -sh /var/cache/apt/archives

Clear the download cache and remove packages that nothing depends on anymore:

sudo apt clean
sudo apt autoremove --purge

A full /boot is a related but separate problem. Each kernel version takes space there, and if old kernels pile up, the next kernel upgrade fails halfway. apt autoremove normally removes old kernels, but if it cannot run because the upgrade is stuck, list what is installed with dpkg -l 'linux-image-*' and remove an old version you are not currently booted into (check uname -r first). The speed-up guide has more on keeping the system lean so this does not recur.

Preventing the Next apt Error

A few habits remove most of the risk:

  • Use sudo parrot-upgrade as your normal upgrade command, and run it when you have time to watch it finish. Plug the laptop in first.
  • Do not add repositories from other distributions. If you need a package Parrot lacks, use Flatpak, a container, or build from source into /usr/local or your home directory.
  • Keep a few gigabytes free on the root partition, and let apt autoremove clean old kernels.

FAQ

Is it safe to delete apt lock files?

Only when nothing is using them. Check with lsof first. Deleting a lock while dpkg is actually running can corrupt the package state and turn a one-minute wait into an hour of repair.

Why does parrot-upgrade work when apt upgrade says packages are kept back?

parrot-upgrade performs a full upgrade, which is allowed to install new packages and remove obsolete ones. Plain apt upgrade refuses to do either, so new kernel versions and renamed metapackages stay “kept back” until you run the full form.

Can I fix a Parrot Linux apt error by switching to the Kali repository?

No. Mixing Kali and Parrot sources creates conflicting versions of core packages and typically breaks the system. If you want Kali’s tool set, run Kali in a VM alongside Parrot instead of merging repositories.