[Solved] RPM Failed Dependencies Error in RedHat

LINUX
FUNDAMENTALS
A Complete Guide for Beginners Enroll Course Now

Dependency refers to a relationship among software packages that indicates that one package relies on another to function correctly. Actually, dependencies are used to ensure that the required packages are installed on a system before a particular software package can be installed or run successfully. However, “RPM failed dependencies” is an error due to either missing or incompatible packages that are dependencies for your system. In this tutorial, I’ll discuss some common reasons of RPM failed dependencies and how to mitigate them.

Key Takeaway

  • Installing RPM package in RHEL.
  • Inspecting dependency issues regarding red hat package installation.
  • Resolving failed dependencies using different package managers.

Requirements

  • System running on RHEL/Fedora.
  • Sudo privileges to use the core functionality of package managers.

Cause of RPM Failed Dependencies

There are several potential causes for RPM (Red Hat Package Manager) failed dependency errors:

  • Missing Dependencies: The most common cause is that one or more required dependencies are not installed on the system.
  • Incompatible Versions: The installed versions of packages may be incompatible with the version required by the package you’re trying to install.
  • Conflicting Packages: Another package with the same name but different contents may be installed, causing conflicts with the package you want to install.
  • Repository Issues: The repository from which you’re trying to install the package may be misconfigured or incomplete. Ensure that your repositories are correctly set up and up-to-date.
  • Corrupted RPM Database: Corruption in the RPM database can lead to dependency issues. This can happen due to filesystem errors or system crashes.
  • Dependency Chain: Sometimes, a dependency issue is a part of a chain of dependencies. One package depends on another, which depends on yet another, and so on. If any link in the chain is broken, it can result in a dependency failure.

7 Solutions to Resolve RPM Error: Failed Dependencies in RedHat

If you encounter RPM package installation errors due to failed dependencies, it generally means that the package you are trying to install depends on other packages or libraries that are either missing or incompatible with your system. For example, I have downloaded an RPM file of Google Chrome, and it raised a failed dependency error when I tried to install it.raised failed dependency error when installing chromeIn this tutorial, I’ll show you some recovery techniques so that you can resolve failed dependency errors from the above-like situation.

Reason 01: Missing Dependencies

The most common cause of RPM failed dependencies is missing dependencies, which means that one or more required dependencies are not installed on the system. When you encounter missing dependencies while installing software on a Red Hat-based system you can follow the below solutions to resolve it.

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

Solution 01: Install Dependency Using YUM to Resolve RPM Error Failed Dependencies

YUM and Yumdownloader are two CLI (Command Line Interface) utilities used in Red Hat-based Linux distributions for package management. Yumdownloader focuses on downloading RPM packages from repositories, rather than installing or managing them. It allows you to download individual packages and their dependencies to a specified directory. So, you can use it to download the required dependencies and then install it using YUM.

Now, follow these steps to resolve failed dependencies of Google Chrome using yumdownloader:

Steps to Follow >

➊ Open the RHEL/Fedora terminal.

➋ Make a separate folder and navigate to it by the below commands:

mkdir ~/myfolder

cd ~/myfolder
EXPLANATION
  • mkdir: Command to create a new directory.
  • cd: Command to Change Directory to the specified one.
  • ~/myfolder: Absolute path of the newly created folder.
creating and navigating to directory myfolder

Note: You can use any name instead of myfolder, but consider the same name you choose in all the commands in this solution.

➌ Now, run the command to download all dependencies of Google Chrome.

sudo yumdownloader --resolve google-chrome-stable
EXPLANATION
  • sudo: Enables administrative permission.
  • yumdownloader: Command-line utility used for downloading RPM packages from YUM repositories.
  • –resolve: This option instructs yumdownloader to resolve and download not only the specified package (“google-chrome-stable“) but also all its dependencies.
  • google-chrome-stable: Full name of the package.
download dependencies of google chrome by yumdownloaderThe above command will download necessary dependencies of Google Chrome package.

➍ Type the user password and press ENTER.

➎ Now, run the command to install package with the dependencies:

sudo yum install -y *.rpm
EXPLANATION
  • yum: Uses YUM package manager.
  • install: Command to install package using YUM.
  • -y: Answer YES automatically to all the confirmation prompts.
  • *.rpm: Indicates every file in the current directory which has .rpm
installing all dependency files by yum ➏ After running the above command, you can check whether the package is installed or not by the command below:

yum list installed | grep chrome
EXPLANATION
  • list: Command to make a list.
  • installed: Shows the name of all installed package.
  • | (Piping Symbol): Transfers the output of a command as the input of the next command.
  • grep: Searches for a keyword or pattern from output in the terminal.
  • chrome: Keyword from the name of the package that I want to search.
Checking if RPM failed dependencies is solved by yumThe output shows that google-chrome is installed. That means you’ve resolved the failed dependency error and successfully installed the package.

Solution 02: Install Dependency Using DNF to Resolve RPM Error Failed Dependencies

DNF stands for “Dandified Yum” and is a software package management utility used in modern Red Hat-based Linux distributions, such as Fedora, CentOS, and RHEL (Red Hat Enterprise Linux). DNF is the successor to the older yum package manager and offers several improvements and enhancements. You can use it to download and install dependency packages in the following ways to resolve failed dependencies.

Steps to Follow >

➊ Open the RHEL/Fedora terminal.

➋ Make a separate folder, navigate to it and download the required dependencies by the below commands:

mkdir ~/mydirectory

cd ~/mydirectory

sudo dnf download google-chrome-stable
EXPLANATION
  • mkdir: Command to create a new directory.
  • cd: Command to Change Directory to the specified one.
  • ~/mydirectory: Absolute path of the newly created folder.
  • download: Command for downloading a package.
  • google-chrome-stable: Name of the package.
downloading dependencies of chrome by dnf in mydirectoryThe above commands will download the necessary files of the Google Chrome package in mydirectory folder.

Note: You can use any name instead of mydirectory, but consider the same name you choose in all the commands in this solution.

➌ Now, run the command to install the package with dependencies:

sudo dnf install -y *.rpm
EXPLANATION
  • sudo: Enables administrative privileges.
  • dnf: Uses DNF package manager.
  • install: Command to install package using DNF.
  • -y: Answer YES automatically to all the confirmation prompts.
  • *.rpm: Indicates every file in the current directory which has .rpm

➍ Type the user password if asked and press ENTER.Installing all failed dependencies by dnf➎ After running the above command, you can check whether the package is installed or not by the command below:

dnf list installed | grep chrome
EXPLANATION
  • list: Command to make a list.
  • installed: Shows the name of all installed package.
  • | (Piping Symbol): Transfers the output of a command as the input of the next command.
  • grep: Searches for a keyword or pattern from output in the terminal.
  • chrome: Keyword from the name of the package that I want to search.
Checking if RPM failed dependencies is resolved by dnfThe output shows that google-chrome is installed. That means you’ve resolved the failed dependency error and successfully installed the package.

Solution 03: Install Dependency Using RPM to Resolve RPM Error Failed Dependencies

RPM (Red Hat Package Manager) is the default package management tool for RedHat-based Linux distributions. It can download and install any RPM packages that can be helpful in solving the rpm error failed dependency issue. So, you can use it to download the rpm file of the package and required dependencies and then install them using RPM.

Now, follow these steps to manually resolve failed dependencies of Google Chrome using rpm:

Steps to Follow >

➊ Open the RHEL/Fedora terminal.

➋ Make a separate folder, navigate to it and download required dependencies by the below commands:

mkdir ~/mychrome

cd ~/mychrome

wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
EXPLANATION
  • mkdir: Command to create a new directory.
  • cd: Command to Change Directory to the specified one.
  • ~/mychrome: Absolute path of the newly created folder.
  • wget: Command which downloads files or webpages non-interactively from the network.
Manually downloading chrome packages by wget in mychrome directoryThe above commands will download the necessary files of Google Chrome package in mychrome folder.

Note: You can use any name instead of mychrome, but consider the same name you choose in all the commands in this solution.

➌ Try running this command for installing the downloaded package:

sudo rpm -ivh *.rpm
EXPLANATION
  • sudo: Enables administrative privileges.
  • rpm: Lists all files and folders in the current directory.
  • -ivh: Combined options that indicate the following:
Option Meaning
-i Option to install a package using rpm.
-v This option is used for verbose (detailed information about the installation process) output.
-h Displays a progress bar as a series of hash (#) symbols during the installation.
  • *.rpm: Indicates every file in the current directory which has .rpm.

➍ Type the user password and press ENTER.Raised failed dependency on liberation-fontBut it shows a failed dependency error on liberation-fonts. Execute the command in the next step to install liberation-fonts.

➎ Now, run the below command to resolve liberation-fonts:

sudo yum install -y liberation-fonts
EXPLANATION
  • yum: Uses YUM package manager.
  • install: Command to install package using DNF.
  • -y: Answer YES automatically to all the confirmation prompts.
  • liberation-fonts: Name of the failed dependency package.
Installing liberation-fonts by yumThe above command will resolve failed dependency error of liberation-fonts.

Note: If you see error dependency on other packages, use the package name instead of liberation-fonts in the above command. In case you see multiple packages in failed dependency list, write them separated by SPACE in the above command. For example:

sudo yum install -y <failed dependency 1> <failed dependency 2> …

Use the name of failed dependency packages in the place of <failed dependency 1>, <failed dependency 2>.

➏ After resolving dependencies, you can run the command shown in step ➌ to install the package.Error free installation of chrome by rpmThis time it shows no failed dependency and installs the package completely.

➐ After running the above command, you can check whether the package is installed or not by the command below:

rpm -qa | grep google-chrome
EXPLANATION
  • rpm: Uses RPM package manager.
  • -qa: Stands for Query A This is used to query the status of all installed packages.
  • | (Piping Symbol): Transfers the output of a command as the input of the next command.
  • grep: Searches for a keyword or pattern from output in the terminal.
  • google-chrome: Keyword from the name of the package that I want to search.
Checking if RPM failed dependency is resolved by rpmThe output shows that google-chrome is installed. That means you’ve resolved the failed dependency error and successfully installed the package.

Reason 02: Incompatible Versions/Conflicting Packages

Incompatible versions or conflicting packages occur when you try to install software that relies on different versions of a library or component than what is already installed on your system. This can lead to issues with software functionality or system stability. Here’s how to handle incompatible versions or conflicting packages.

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 Resolve RPM Error Failed Dependencies

When you face incompatible versions or conflicting package errors, it means you may have installed a version of a dependency package that is not compatible with the system. So, first you have to remove it and try to reinstall it by the following steps.

Steps to Follow >

➊ Open the RHEL/Fedora terminal.

➋ Type the following command to remove the package with all its dependencies:

sudo yum remove google-chrome-stable
EXPLANATION
  • sudo: Grants administrative permissions.
  • yum: Calls YUM package management tool.
  • remove: Command to remove a package using yum.
  • google-chrome-stable: Name of the package that raised failed dependency.

➌ Type the user password and press ENTER.

➍ Type Y and press ENTER when the confirmation prompt appears.Removing google chrome with RPM failed dependency by yumThe above command will remove Google Chrome with all the incompatible dependencies from your system.

➎ Now, try reinstalling it by the following command:

sudo yum install -y google-chrome-stable
EXPLANATION
  • install: Command to install package using YUM.
  • -y: Answer YES automatically to all the confirmation prompts.
  • google-chrome-stable: Name of the package.

➏ Enter the user password if asked.Reinstalling google chrome by YUMThis will reinstall the package resolving all the incompatibilities by YUM automatically.

Solution 02: Using DNF to Resolve RPM Error Failed Dependencies

Dandified Yum, shortly known as DNF, is the updated version of YUM and can also be used to resolve incompatibility issues. Follow the below guidelines for this purpose.

Steps to Follow >

➊ Open the RHEL/Fedora terminal.

➋ Type the following command to remove the package with all its dependencies:

sudo yum remove google-chrome-stable
EXPLANATION
  • sudo: Grants administrative permissions.
  • dnf: Calls DNF package management tool.
  • remove: Command to remove a package using yum.
  • google-chrome-stable: Name of the package that raised failed dependency.

➌ Type the user password and press ENTER.

➍ Type Y and press ENTER when the confirmation prompt appears.Removing google chrome with RPM failed dependencies by dnf➎ Now, try reinstalling it by the following command:

sudo dnf install -y google-chrome-stable
EXPLANATION
  • install: Command to install package using YUM.
  • -y: Answer YES automatically to all the confirmation prompts.
  • google-chrome-stable: Name of the package.

➏ Enter the user password if asked.Reinstalling google chrome by dnfThis will reinstall the package resolving all the incompatibilities by DNF automatically.

Reason 03: Repository Issues

Repositories are the storehouse of packages wherefrom package managers collect packages and necessary information about dependencies of the package. For RPM packages, failed dependency can occur if the repository from which you’re trying to install the package may be misconfigured or incomplete. So, ensuring that your repositories are correctly set up and up-to-date may solve the issue.

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

Solution 01: Updating Repositories Using Package Managers

The package manager (dnf or yum) on Red Hat-based systems serves you the best in resolving these 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:

Steps to Follow >

➊ Open the RHEL/Fedora terminal.

➋ 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.

➌ Type the user password and press ENTER.Updating repository by yum➍ 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 02: Clearing Cache

Both yum and dnf maintain cache to speed up package management tasks. However, clearing the cache can be useful when you want to ensure that you are fetching the latest package information from the repositories. YUM and DNF provide specific cache clearing commands:

Command for Clearing YUM Command DNF Command
Package cache sudo yum clean packages sudo dnf clean packages
Metadata cache sudo yum clean metadata sudo dnf clean metadata
Header cache sudo yum clean headers sudo dnf clean headers
Clearing all cache sudo yum clean all sudo dnf clean all

If you are not sure which cache is causing the error, you can remove all kinds of cache. Here’s how you can clear all the cache.

Steps to Follow >

➊ Open the RHEL/Fedora terminal.

➋ 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 for performing cache-cleaning operations.
  • all: This argument specifies that you want to clean all types of cache, including metadata, packages, and headers.

➌ Enter the user password.Clearing all cache by DNFThe above command will remove a number of cache files. After clearing the files, you can retry to install the package that showed failed dependency.

Comparative Analysis of Methods

I’ve shown different ways to solve rpm failed dependencies error according to the reasons. You might be confused to decide which one suits you the best. Here’s a comparison between the methods provided to give you an overview of the pros and cons.

  Solution Pros Cons
Reason 1 Solution 1
  • Allows to download packages without installing them.
  • Use online repositories with advanced package management that ensures automatic resolution of dependencies.
  • Repository configuration can be a trouble when you try to install software from third-party repository.
Solution 2
  • It uses modern libraries like libsolv and hawkey to improve performance.
  • Faster than YUM
  • Provides more robust dependency resolution, resulting in fewer dependency-related issues.
  • Like other package managers, dnf relies on network connectivity to download packages and metadata.
Solution 3
  • It’s suitable for cases where you want to handle packages individually.
  • Allows to run multiple versions of the same dependency package thus helping in resolving failed dependencies.
  • Does not automatically resolve dependencies.
  • Managing dependencies with rpm can be complex and time-consuming, especially for software with many dependencies.
Reason 2 Solution 1
  • Available on older Red Hat-based systems and can be useful when dealing with legacy systems.
  • Can handle basic dependency resolution, making it suitable for resolving version conflicts.
  • May struggle with complex dependency chains.
  • Lacks some of the newer features and improvements found in dnf.
Solution 2
  • Designed to handle complex dependency resolution more efficiently.
  • Provides a more consistent and user-friendly command-line interface compared to yum.
  • For users who are accustomed to yum, there might be a slight struggling when transitioning to dnf.
Reason 3 Solution 1
  • 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 2
  • 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 problem 1 (Missing dependencies), Use solution 1 or 2 if you are a beginner and stuck in installing a package you want to install for your daily purpose. But if you are a developer and trying to do some experiments of package behavior under different dependencies, use solution 3 because it will facilitate you to manually download a specific version of dependencies.

For problem 2 (Incompatible version), use solution 1 if you are using an older version of RHEL. In case you are using the latest version of RHEL greater than 8, use solution 2 because it will provide you with more automatic resolution for failed dependencies.

Finally for problem 3 (Repository issues), if you haven’t updated your repositories for a long time, use solution 1. On the other hand, if you know which cache is causing the error, you can use solution 2. Please note that you can use both of the solutions one after one.

Conclusion

When you encounter rpm failed 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 fix error failed dependencies?
When you face failed dependencies, there may be several reasons causing it. However, a general solution can be updating the repository by sudo yum update and then try reinstalling the package by sudo yum install <package name>. Use the actual name of the package instead of <package name> in the command.
How to install dependencies for RPM package?
You can download all the dependencies of an RPM package and then install them by YUM and Yumdownloader. Before proceeding, it is recommended to create a separate folder, navigate to it and then download all dependencies of the package by sudo yumdownloader –resolve <package name>. Use the actual name of the package instead of <package name> in the command. Then use this command to install all of those dependencies: sudo dnf install *.rpm
How to force RPM install without dependencies?
If you have the RPM file of a package and you want to install it without dependencies, you can use the syntax sudo rpm -ivh –nodeps <package.rpm>. Use the actual name of the package with .rpm extension instead of <package.rpm> in the command.
What is RPM dependency?
In the context of RPM (Red Hat Package Manager), dependency refers to a relationship among software packages that indicates that one package relies on another to function correctly. Dependencies ensures that the required libraries, components, or other packages are installed on a system before a particular software package can be installed or run successfully. These dependencies can be of two types: 1) Runtime dependency and 2) Build dependency.
How to install RPM files?
RPM files can be installed using package managers such as rpm and dnf. If you want to install an RPM file while resolving all dependencies automatically, use dnf with the syntax sudo dnf install <package.rpm>. But if you want manual dependency resolution or install only a specific RPM file without dependencies, use sudo rpm -ivh –nodeps <package.rpm>. Use the actual name of the package with .rpm extension instead of <package.rpm> in the command.

Related Articles


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

4.8/5 - (6 votes)
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

Leave a Comment