Fix Package Manager Issues

Here are ways to resolve installation, update, upgrade, and other package-related issues.

System-wide packages (APT/DPKG)

If your system complains about a failed upgrade, package manager conflicts, broken packages, or other package-related issues, there are several common fixes to these problems.

You can resolve some package manager issues with a graphical app, but many require the command line. If you see a red circle in the panel indicators, try opening the Terminal (Zorin Menu → Utilities → Terminal) and running these commands to fix the package manager:

sudo apt clean
sudo apt update
sudo dpkg --configure -a
sudo apt install -f
sudo apt full-upgrade
sudo apt autoremove --purge

What do these commands do?

  • sudo …
    This prefix runs the following command with administrator privileges. This is required when making changes to the system packages.
  • apt clean
    Clears out previously retrieved package files from the system’s local cache.
  • apt update
    Fetches indexes from all configured sources. Other apt options use these indexes to determine which packages can be upgraded or installed.
  • dpkg --configure -a
    Configures any unpacked but not yet configured packages.
  • apt install -f
    The -f option attempts to correct broken dependencies
  • apt full-upgrade
    In addition to downloading and installing package updates, this downgrades or removes dependencies as necessary when upgrading packages.
  • apt autoremove --purge
    Running this command with no specified package will remove any packages that were previously dependencies for other installed packages but are no longer required (either because the dependent package was removed, or because the package was updated to no longer depend on certain packages.)

Fix individual packages

Sometimes, you may see some packages that are still broken and need to be installed manually or purged manually. There may be broken dependencies or cyclical dependencies. If so, these commands can help:

Use this command to reinstall the package, replacing “package-name” with its correct name. This can be convenient when the package has many reverse dependencies:

sudo apt install --reinstall package-name

If that didn’t resolve the issue, you can use this command to remove the package and its system-wide configuration files:

sudo apt purge package-name

Reinstall the package with this command:

sudo apt install package-name

Held packages

If you previously held/locked the installed versions of system packages (so they can’t be updated further), you may experience issues with installing software updates and upgrading your system.

To view any packages you previously held, you can run this command in the Terminal:

apt-mark showhold

To remove the version hold on this package, you can run the following command, replacing “package-name” with its correct name:

sudo apt-mark unhold package-name

Alternatively, you can remove the version holds on all packages on your system with this command:

sudo apt-mark unhold $(apt-mark showhold)

Remote repositories can’t be reached

If the Software Updater app or Terminal indicates that some remote repositories can’t be reached, you may have added a third-party software repository that is either configured incorrectly or is experiencing temporary server errors.

To identify the affected software repository and resolve this issue, please follow the steps in the guide linked below:

Fix error with third-party repositories ›

Useful apps

The Synaptic Package Manager app is a powerful graphical frontend for the APT package manager. You can install, remove, selectively upgrade, or pin packages and gain information about their purpose and dependencies. It also provides a comprehensive list of available packages and apps that you can download.

Learn more about the Synaptic Package Manager ›

Flatpak packages

If the Software store is showing available updates, but can’t install them after clicking the “Update All” button, there may be Flatpak runtimes (backend software that other Flatpak packages depend on) with updates available.

Open the Terminal and run these three commands to update all Flatpaks and remove any Flatpak runtimes that are no longer required by any installed app:

flatpak update
flatpak uninstall --unused
flatpak repair --user

Snap packages

Snaps usually update themselves as needed. However, if you would like to manually update the Snaps on your system, run these two commands:

snap refresh --list
sudo snap refresh 

Run this command to remove a Snap package, replacing “package-name” with its correct name:

sudo snap remove package-name