[Solved] The Following Packages Have Unmet Dependencies Error

A package with unmet dependencies is a software package that cannot be installed or updated because it relies on other packages or libraries that are either missing or have incompatible versions on your system. Unmet dependencies can prevent the package manager (e.g. YUM, DNF, APT) from installing or updating software correctly. In this tutorial, I’ll discuss some common reasons for the error “The following packages have unmet dependencies” in different Linux distributions and how to mitigate them.

Cause of Packages Unmet Dependencies

Unmet dependencies can occur in both Debian-based Linux distribution (Ubuntu) and Red Hat-based distribution (RHEL/CentOS/Fedora) for similar reasons, although their package management tools differ. Here are some common causes of unmet dependencies in both distributions:

  • Repository Configuration Issues: If the repositories are not correctly configured in /etc/apt/sources.list or /etc/apt/sources.list.d/, APT may not be able to locate the necessary packages. In RHEL, repository configuration issues in the /etc/yum.repos.d/
  • Manual Package Installations: Installing packages manually e.g. using dpkg -i in Ubuntu without resolving dependencies can result in unmet dependencies. However, using the rpm -i command to install packages in RHEL can lead to a similar issue.
  • Dependency Chain Conflict: Sometimes, resolving one set of dependencies can create conflicts with another package’s dependencies, resulting in unmet dependencies.
  • Software Sources Priority: APT uses package pinning to determine which version of a package to install. If package pinning is not set correctly, it may install an incompatible version. On the other hand, priority settings for repositories in RHEL can affect which package versions are considered for installation. If not configured correctly, this can lead to unmet dependencies.

Preliminary Solutions to Unmet Dependencies Error in Linux

Before heading into the main solution techniques, I want to discuss two methods that may solve the packages’ unmet dependency problem for most of the users. So, I suggest you try the preliminary solutions first and then try the other solutions discussed later on if these fail.

1. Debug and Upgrade the Packages

One of the primary fixes of unmet dependencies can be to debug all the packages that are listed in the snippet by running the command for the upgrade. To automatically debug all the packages and upgrade them to remove the error, open the Ubuntu terminal and type the following command:

sudo apt -o Debug::pkgProblemResolver=yes dist-upgrade
EXPLANATION
  • sudo: Enables administrative permissions.
  • apt: Calls APT package management tools.
  • -o Debug::pkgProblemResolver=yes: An option passed to apt that instructs it to enable debugging output for the package problem resolver to provide additional information about why a particular package upgrade might be failing due to unresolved dependencies or conflicts.
  • dist-upgrade: This command ensures that all packages are upgraded to their latest versions while resolving any dependency or conflict issues.

running apt debug command to see unmet dependenciesThe above commands may fix the issue. But if you still face unmet dependencies errors like the above picture, try the next one.

2. Remove and Install the Packages

Removing and then reinstalling a package can be beneficial in solving unmet dependency issues in all Linux distributions because it forces the package manager to re-evaluate the package’s dependencies and try to resolve any issues that might have arisen. Here’s how this process can help in Ubuntu:

  1. Open the Ubuntu terminal.
  2. Run the following command to remove the package:
    sudo apt remove <package name>
    EXPLANATION
    • sudo: Enables administrative permissions.
    • apt: Calls APT package management tools.
    • remove: Command to remove a package using apt.
    • <package name>: Name of the package that raised unmet dependency error.
  3. Enter the user password.
  4. Now, run the following command to install the package:
    sudo apt install -y <package name>
    EXPLANATION
    • install: Command for installing packages using apt.
    • -y: Answer YES automatically to all the confirmation prompts.

    Note: Replace <package name> in the above commands with the actual name of the package.removing and reinstalling teamviewer by aptI have applied the method for resolving unmet dependencies of TeamViewer. The first command removed teamviewer package. Then the second command installed teamviewer with necessary dependencies.

Note: If you are using a RedHat-based Linux distribution such as RHEL/Fedora/CentOS, you can use the below set of commands for removal and reinstallation of the package:

sudo yum remove <package name>

sudo yum install -y <package name>

Replace <package name> in the above commands with the actual name of the package.

6 Solutions to Resolve Packages Have Unmet Dependencies Error in Ubuntu

If you encounter package installation errors due to unmet dependencies, it generally means that the package you are trying to install depends on other packages or libraries that are either incompatible or the repository is not correctly configured with your system. For example, I have downloaded a DEB file of TeamViewer, and it raised an unmet dependency error when I tried to install it.unmet dependencies error occurred while installing teamviewer The output shows that installing teamviewer_15.44.5-1_amd64.deb was unsuccessful because it depends on libminizip1 which is unmet.

However, you may face more than one dependency unmet or missing while installing other software. In this tutorial, I’ll show you some recovery techniques so that you can resolve unmet dependency errors from the above-like situation.

You can read our Comparative Analysis of Methods to distinguish between these solutions and pick the best one for your needs.

Solution 01: Using “APT/APT-GET” to Resolve Unmet Dependencies

APT (Advanced Package Tool) is a powerful package management system used in Debian-based Linux distributions, including Ubuntu. It simplifies package management by handling dependencies automatically. When the installation is stuck due to unmet dependencies, follow these steps to install them with apt:

  1. Open the Ubuntu terminal.
  2. Run the following command:
    sudo apt install -f
    EXPLANATION
    • sudo: Enables administrative permissions.
    • apt: Calls APT package management tools.
    • install: Command for installing package using apt.
    • -f: Flag that indicates to fix the missing dependencies.
  3. Type Y and press ENTER when the confirmation prompt appears.Fixing unmet dependency error by aptThe above command detects all unmet dependencies and installs them automatically.
Note: Additionally, you can use apt-get which is a command-line tool commonly used tools for package management in Ubuntu. The command to install missing dependencies using the apt-get command is:
sudo apt-get install -y –fix-broken

This command also serves the same as APT.

Solution 02: Using “Aptitude” to Fix Unmet Dependencies

Aptitude is a package management tool in Ubuntu and other Debian-based Linux distributions. It provides a Text-based User interface (TUI) for managing software packages on your system. It is known for its advanced and robust dependency resolution capabilities, which can be particularly helpful in resolving unmet dependencies. Aptitude assists in solving unmet dependency issues in the following ways:

  • Thorough Dependency Analysis: It performs a comprehensive analysis of not only the direct dependencies of the requested packages but also the indirect dependencies, ensuring a complete picture of the package ecosystem.
  • Interactive Conflict Resolution: If there are conflicting packages or unmet dependencies, it presents options to the user, suggesting various solutions to resolve the issue.
  • Dependency Conflict Avoidance: It aims to avoid dependency conflicts by proactively evaluating multiple solutions for satisfying dependencies, and it tries to select a solution that results in the least disruption to the system while meeting the requirements.
  • Alternative Solutions: If there are multiple ways to satisfy a package’s dependencies, aptitude presents alternative solutions and allows you to explore them.
  • Compatibility Checks: It checks for package compatibility with the current system configuration, ensuring that the packages selected for installation or upgrade are suitable for the specific version of Ubuntu you are using.
  • Package States: It tracks the state of packages on your system, including whether they were installed manually or as dependencies. This information is valuable for making decisions about package removal and system cleanup.

Here’s how to use aptitude for resolving unmet dependencies:

  1. Open the Ubuntu terminal.
  2. Run the following command to install aptitude:
    sudo apt install -y aptitude
    EXPLANATION
    • sudo: Enables administrative permissions.
    • apt: Calls APT package management tools.
    • install: Command for installing a package using apt.
    • -y: Answer YES automatically to all the confirmation prompts.
    • aptitude: Aptitude package name.
  3. Enter the user password.
  4. Now, run this command to fix unmet dependencies by aptitude:
    sudo aptitude install -f
  5. Type Y and press ENTER to accept the solution provided by aptitude.fixing The following packages have unmet dependencies error by aptitudeAfter accepting the solution, aptitude will install the required package and solve the problem of unmet dependencies.

Solution 03: Removing PPAs Using “Software Updater”

PPAs often provide packages that are built for specific Ubuntu releases. When you remove a PPA, you eliminate the packages it provides, which might be causing conflicts or unmet dependencies because they aren’t compatible with your current Ubuntu version. Moreover, Ubuntu’s package manager (apt or apt-get) can have difficulty resolving dependencies when packages from multiple sources, including PPAs, are involved. Removing a problematic PPA simplifies the package manager’s task of resolving unmet dependencies. Here’s how to remove third-party PPAs:

  1. Open Software Updater from the Show Applications section.Opening Software updater in ubuntu
  2. Click on Settings.Clicking into settings button
  3. Navigate to Other Software.Navigating to other software section of software updater
  4. If you find any URL checked, this may be the reason for conflicting dependencies. So, uncheck it.Unchecking third-party PPAs URL
  5. Type the user password and click on Authenticate.Entering user password to authenticate software updater
  6. Click on Close.
  7. Click on Reload when prompt appears.Reloading software updater Now, try to install the package that showed unmet dependency. You can add the PPA later by checking the URL in a similar process.

Solution 04: Update Repository Using “APT”

The APT package manager on Ubuntu systems serves you the best in resolving dependency issues. However, try using it to update the repository or install the software you need. It will automatically handle dependencies and conflicts, upgrading or downgrading packages as necessary to maintain compatibility. Follow the steps to update repositories:

  1. Open the Ubuntu terminal.
  2. Type the following command:
    sudo apt update && sudo apt upgrade
    EXPLANATION
    • sudo: Grants administrative permissions.
    • apt: Calls APT package management tool.
    • upgrade: Upgrade all packages on the system to their latest versions.
    • &&: Symbol to represent AND. Here it merges the two commands.
    • update: Update packages and install new packages if they are available in the repositories and meet the update criteria.
  3. Type the user password and press ENTER.updating and upgrading repository by apt This upgradation will reconfigure repositories and resolve unmet dependency issues.

Note: You could use APT-GET instead of APT for the repository upgradation. The command is:

sudo apt-get update && sudo apt-get upgrade

Solution 05: Clear Cache and Reinstall Package

Clearing the cache removes downloaded package files (.deb files) that are cached on your system. It can free up disk space but doesn’t remove installed packages. However, clearing the cache can be useful when you want to ensure that you are fetching the latest package information from the repositories. Reinstalling the package after clearing the cache can be a useful solution for unmet dependencies. Here’s how to do it:

  1. Open the Ubuntu terminal.
  2. Run the below commands to clear all cache and reinstall TeamViewer.
    sudo apt clean all
    
    sudo apt install –reinstall teamviewer
    EXPLANATION
    • sudo: Grants administrative permissions.
    • apt: Calls APT package management tool.
    • clean: This is the subcommand used to perform cache-cleaning operations.
    • all: This argument specifies that you want to clean all types of cache, including metadata, packages, and headers.
    • install: Command for installing package using apt.
    • –reinstall: Command to remove the existing version and install the package again.
    • teamviewer: Name of the package.
  3. Enter the user password if asked.Clearing cache and reinstalling teamviewer shows The following packages have unmet dependency againThe above commands generally fix the issue. But if you still face unmet dependencies error like the above picture, follow next step:
  4. Run the below command:
    sudo apt install –fix-broken
    
    sudo apt install –reinstall teamviewer
  5. Type Y and press ENTER when the confirmation prompt appears.Reinstalling teamviewer by successfully resolving unmet dependency errorThis time, apt will resolve the unmet dependencies and reinstall the package successfully.

Solution 06: Using “Synaptic” Package Manger GUI

Synaptic Package Manager, often denoted as “Synaptic”, is a GUI (Graphical User Interface) package management tool for Debian-based Linux distributions. interfaces that also handle dependencies and other package management tasks effectively. Follow these steps to resolve unmet dependencies automatically using Synaptic in Ubuntu:

  1. Open Synaptic Package Manager from the Show Applications section.Opening synaptic package manager from show application section
  2. Type user password in the authentication window and click Authenticate.Entering user password to authenticate synaptic package manager
  3. Select Broken from the Custom Filters section. It will list the packages that are broken due to missing or unmet dependencies.
  4. Right click on the package and select Mark for Upgrade.Filtering broken dependencies to see the list of unmet dependenciesThis will detect the unmet dependency packages automatically.
  5. Click on Mark.Marking for installation of unmet dependency packagesAfter that, Synaptic will install the detected unmet dependencies. You can check it by clicking Reload located at the top-left of the synaptic window.

3 Solutions to Resolve Packages Have Unmet Dependencies in Red Hat

Unmet dependencies can occur in Red Hat-based distribution (RHEL/CentOS/Fedora) for similar reasons as Debian-based Linux distribution (Ubuntu). Generally, errors due to unmet dependencies means that the package you are trying to install depends on other packages or libraries that are either incompatible or somehow unmet the required version with your system.

You can read our Comparative Analysis of Methods to distinguish between the solutions and pick the best one for your needs.

Solution 01: Using “YUM” to Solve Unmet Dependencies

YUM is a CLI (Command Line Interface) utility used in Red Hat-based Linux distributions for package management. It focuses on installing or managing RPM packages from repositories allowing you to download packages with their necessary dependencies and install them automatically. To use YUM options to solve unmet dependencies issues regarding Firefox, open the RHEL/Fedora terminal and Run the following command:

sudo yum install -y --setopt=tsflags=nodocs firefox
EXPLANATION
  • sudo: Grants administrative permissions.
  • yum: Calls YUM package management tool.
  • install: Command to install package using YUM.
  • -y: Answer YES automatically to all the confirmation prompts.
  • –setopt=tsflags=nodocs: Instructs the package manager not to install any documentation files associated with the packages being installed or updated.
  • firefox: Name of the package.
Using yum setopt to resolve unmet dependencies of firefoxThis will fix a broken installation caused by unmet dependencies using yum.

Solution 02: Update Repository Using “YUM/DNF”

The package manager (DNF and YUM) on Red Hat-based systems serves you the best in resolving unmet dependencies issues. Try using it to update the repository or install the software you need. It will automatically handle dependencies and conflicts, upgrading or downgrading packages as necessary to maintain compatibility. Follow the steps to update repositories:

  1. Open the RHEL/Fedora terminal.
  2. Type the following command:
    sudo yum upgrade && sudo yum update
    EXPLANATION
    • sudo: Grants administrative permissions.
    • yum: Calls YUM package management tool.
    • upgrade: Upgrade all packages on the system to their latest versions.
    • &&: Symbol to represent AND. Here it merges the two commands.
    • update: Update packages and install new packages if they are available in the repositories and meet the update criteria.
  3. Type the user password and press ENTER.updating repository by yum resolves unmet dependencies of various package
  4. Type Y and press ENTER when the confirmation prompt appears.

    This upgradation will reconfigure repositories, install the broken package and resolve failed dependency issues.

Note: You could use DNF instead of YUM for the repository upgradation. The command is:

sudo dnf upgrade && sudo dnf update

Solution 03: Clear Cache and Reinstall in RedHat

Both yum and dnf maintain cache to speed up package management tasks. Clearing the cache can be useful when you want to ensure that you are fetching the latest package information from the repositories. Reinstalling the package after clearing the cache can be a useful solution for unmet dependencies.

  1. Open the RHEL/Fedora terminal.
  2. Run the command to clear all cache
    sudo yum clean all

    OR,

    sudo dnf clean all
    EXPLANATION
    • yum / dnf: The package manager itself.
    • clean: This is the subcommand used to perform cache-cleaning operations.
    • all: This argument specifies that you want to clean all types of cache, including metadata, packages, and headers.
  3. Enter the user password.Clearing cache by dnf to resolve the following packages have unmet dependencies issuesThe above command will remove a number of cache files.
  4. Now, you can retry to install the package that showed unmet dependency by the command:
    sudo dnf reinstall -y <package name>
    EXPLANATION
    • sudo: Enables administrative privileges.
    • dnf: Uses DNF package manager.
    • reinstall: Command to remove the existing version and install the package again.
    • -y: Answer YES automatically to all the confirmation prompts.
    • <package name>: Name of the package.

    Note: Use the name of the package that has unmet dependencies instead of <package name> in the following command.

  5. Enter the user password if asked.Reinstalling firefox by dnfFixing the unmet dependencies, the above command will reinstall Firefox.

Comparative Analysis of Methods to Solve Unmet Dependencies Error

I’ve shown different ways to solve packages’ unmet dependencies error for different Linux distributions. You might be confused about deciding which one suits you the best. Here’s a comparison between the methods provided to give you an overview of the pros and cons.

Distro Solution Pros Cons
Ubuntu Solution 1
  • Automatically identifies all unmet dependencies.
  • Installs the latest version of the dependency package.
  • Convenient syntax that doesn’t depend on the present working directory.
  • Doesn’t support multiple versions of the same dependency package.
Solution 2
  • When multiple solutions exist for a dependency problem, it offers alternatives and allows users to explore them.
  • Provides detailed explanations of why certain packages are being installed, removed, or upgraded, helping users understand the reasoning.
  • Users can customize aptitude’s behavior through configuration files to tailor it to their preferences.
  • Inexperienced users might accidentally make choices during interactive conflict resolution that lead to unintended package removals or changes.
Solution 3
  • Removing a problematic PPA can help restore system stability and reliability.
  • Eliminates potential conflicts between packages from the PPA and those from the official repositories.
  • Removing a PPA may result in the loss of access to software packages that were only available from that specific repository.
Solution 4
  • Ensures that you have access to the latest versions of software packages available in the repositories.
  • Essential for staying informed about and installing security updates, which help protect your system from vulnerabilities.
  • Repository updates can take time, especially on slow or congested network connections.
  • This can consume bandwidth.
Solution 5
  • Clearing the cache can free up disk space. This can be helpful on systems with limited storage.
  • Ensures that the next package manager operation will retrieve the latest metadata and package information from the repositories.
  • After clearing the cache, the package manager will need to re-download metadata and package information.
Solution 6
  • Automatically identifies all unmet and broken dependencies.
  • Provides a user-friendly GUI that is suitable for beginners.
  • Hides internal complexity from the user.
  • May not provide core customization such as version control.
Red Hat Solution 1
  • Can handle basic dependency resolution, making it suitable for resolving version unmet.
  • Use online repositories with advanced package management that ensures automatic resolution of dependency issues.
  • May look uneasy for beginners unfamiliar with CLI.
  • Repository configuration can be a trouble when you try to install packages from third-party repository.
Solution 2
  • Ensures that you have access to the latest versions of software packages available in the repositories.
  • Essential for staying informed about and installing security updates, which help protect your system from vulnerabilities.
  • Repository updates can take time, especially on slow or congested network connections.
  • This can consume bandwidth,
Solution 3
  • Clearing the cache can free up disk space. This can be helpful on systems with limited storage.
  • Ensures that the next package manager operation will retrieve the latest metadata and package information from the repositories.
  • After clearing the cache, the package manager will need to re-download metadata and package information.

For Ubuntu, if you are comfortable with CLI and want to install all unmet dependencies automatically you can use Solution 1. However, if you are not comfortable with CLI, you can use Solution 6 in this situation. However, if you want to explore suggestions of possible solutions, use solution 2. Additionally, if you know that repository misconfiguration is causing the issue, try using Solution 03 and if it fails, use Solution 04. In case it shows a repository lock or held package error, apply Solution 05.

For RedHat, if you want to install all unmet dependencies automatically you can use Solution 1. However, if you know that repository misconfiguration is causing the issue, try using Solution 02 and if it fails, use Solution 03.

Conclusion

When you encounter packages’ unmet dependency issues, the first step is to carefully read the error messages that are displayed during the installation or update process. These messages often provide valuable information about which packages are conflicting and why. Then apply the solution methods described in this article. Moreover, always try to keep your repositories up-to-date.

People Also Ask

How do I install dependencies for a package?
APT for Ubuntu and YUM for Red Hat will automatically install dependencies when you install a package. The syntax is: sudo apt install <package name> and sudo yum install <package name>. But if you have forcefully installed a package without dependencies and now want to install them, run sudo apt install -f in Ubuntu and sudo dnf install <package name> in Red Hat. Use the actual package name in place of <package name>.
How to resolve package dependencies in Linux?
In Ubuntu, you can resolve any dependencies by sudo apt install -f. In Red Hat, try running sudo dnf install <package name>. Replace <package name> in the above command with the actual name of the package. It will automatically detect necessary dependencies and install them.
What do the following packages have unmet dependencies broken?
The error “The following packages have unmet dependencies” is invoked if the dependency packages are missing, or the repository is corrupted. Furthermore, a reason can be certain packages are being held back by the system.
How to fix dependency in npm?
Run the npm audit fix subcommand to automatically install compatible updates to vulnerable dependencies.

Related Articles

<< Go Back to Dependencies in Linux | Package Management in Linux | Learn Linux Basics

4.9/5 - (7 votes)
LINUX
FUNDAMENTALS
A Complete Guide for Beginners Enroll Course Now
icon linux
Ashikur Rahman

Hello, I’m Ashikur Rahman, currently working as a Linux Content Developer Executive at SOFTEKO. I have completed my graduation in Computer Science and Engineering from Khulna University of Engineering & Technology (KUET). Also, I’m pursuing my master’s in the same department at Bangladesh University of Engineering & Technology (BUET). I like to learn new technologies, contribute, and share those with others. Here my goal is to provide beneficial and user-friendly articles on Linux distribution for everyone. Read Full Bio

2 thoughts on “[Solved] The Following Packages Have Unmet Dependencies Error”

  1. Hi,
    Thanks for your explanations.
    A remark : on my Linux Mint 21.3 Cinnamon the command “sudo apt -o Debug::pkgProblemResolver=yes dist-upgrade” doesn’t work, but the command “sudo apt dist-upgrade -o=Debug::pkgProblemResolver=yes dist-upgrade” works.

    Philippe

    Reply
    • Hi Philippe,
      Most of the time, the command dist-upgrade works fine from both positions. But you don’t have to use ‘dist-upgrade’ twice as you mentioned in your command, use it only after the sudo.
      Thanks a lot for your remark and appreciation.

      Reply

Leave a Comment