Can't install cairo-devel and pango-devel on Centos 8.1 (for Tesseract)

Abstract: Resolve dependency conflicts when installing cairo-devel and pango-devel on CentOS 8.1 by enabling the PowerTools repository and updating system packages.

Created: 2026-08-04 by

Installing cairo-devel and pango-devel on CentOS 8.1 often fails due to dependency conflicts or disabled repositories, particularly when preparing for Tesseract OCR compilation. The primary solution involves enabling the PowerTools repository via dnf config-manager and ensuring all base packages are updated before attempting the installation again.

Understanding the Dependency Conflict

The error typically stems from a missing or disabled repository rather than a broken package. In CentOS 8, development libraries such as those required by Tesseract are not always included in the default BaseOS or AppStream repositories. Specifically, cairo-devel and pango-devel reside in the "PowerTools" (formerly "CodeReady Builder") repository. If this repository is disabled, the package manager cannot resolve the dependencies, leading to transaction failures.

This issue is distinct from general update failures seen in other distributions like Nobara, where protected packages might block operations. As discussed in our guide on Yum/DNF Update Fails: The Operation Would Result in Removing the Following Protected Packages: nobara-amdgpu-config, repository misconfigurations can cause similar semantic errors, though the root cause here is specifically the absence of the development tools repo.

Enabling the PowerTools Repository

To resolve the immediate installation failure, you must explicitly enable the PowerTools repository. This repository contains the build-time dependencies necessary for compiling software from source, including the graphics libraries needed by Tesseract.

  1. Check Current Status: First, verify if the PowerTools repository is enabled by running:
    dnf repolist
    Look for a line containing "powertools". If it is absent or marked as disabled, proceed to the next step.
  2. Enable the Repository: Use the following command to enable the repository permanently:
    dnf config-manager --set-enabled powertools
    On some minimal installations, you may need to install dnf-utils first if the config-manager subcommand is unavailable.
  3. Clean Metadata: Clear the local cache to ensure DNF fetches the latest metadata from the newly enabled source:
    dnf clean all

Alternative Method: Manual Configuration

If the config-manager approach fails, you can manually edit the repository configuration files located in /etc/yum.repos.d/. Look for the file named CentOS-PowerTools.repo (or similar). Ensure that the enabled=1 directive is set within the [powertools] section. Save the file and run dnf makecache to refresh the index.

Updating System Packages

Before installing new development headers, it is crucial to ensure your system is up-to-date. Outdated base packages can conflict with newer development libraries, causing dependency resolution loops. Run the following command to update all installed packages:

dnf update -y

This process ensures that shared libraries like libpng, freetype, and fontconfig are at compatible versions. Failure to update the base system first is a common pitfall that leads to unclear dependency errors, similar to those described in Unclear Answer to 'yum check dependencies' Command in Tech Support. By keeping the base system current, you minimize the risk of circular dependencies during the installation of specialized tools like Tesseract.

Installing Tesseract Dependencies

Once the PowerTools repository is enabled and the system is updated, you can proceed with installing the specific development packages. For Tesseract OCR, you generally need the core libraries along with their development headers.

sudo dnf install cairo-devel pango-devel tesseract-devel

If you are building Tesseract from source, you will also need the standard build tools. Install these using:

sudo dnf groupinstall "Development Tools"

This group includes gcc, make, and cmake, which are essential for the compilation process. After installing these packages, verify the installation by checking the version of the libraries:

pkg-config --modversion cairo
pkg-config --modversion pango

Troubleshooting Remaining Issues

If the installation still fails after enabling PowerTools, consider the following diagnostic steps:

  • Check for Conflicting Repositories: Sometimes, third-party repositories (like EPEL) can introduce conflicts. Ensure EPEL is installed and enabled:
    sudo dnf install epel-release
  • Verify Package Availability: Search for the specific package to confirm it exists in the enabled repos:
    dnf search cairo-devel
  • Review Transaction History: If previous failed attempts left the database in an inconsistent state, use:
    dnf history rollback
    to revert any partial transactions.

In rare cases, disk space issues or permission errors can mimic dependency problems. Always check available disk space with df -h and ensure you have root privileges when modifying system packages.

Frequently Asked Questions

Why does yum check dependencies give unclear answers?

Vague dependency errors often occur when multiple repositories provide conflicting versions of the same library. Running dnf history can help identify recent changes that broke the dependency tree, allowing you to roll back or adjust repository priorities.

Is it safe to enable the PowerTools repository on production servers?

Yes, enabling PowerTools is safe and recommended for systems requiring compilation tools. It does not change default behavior unless explicitly requested, and it only adds development packages that are not part of the standard runtime environment.

How do I forward yum logs for better debugging?

If installation failures persist, forwarding logs to a remote server helps analyze patterns. You can configure rsyslog to send /var/log/yum.log to a central logging server, as detailed in our guide on How to Forward /var/log/yum.log to Remote Logging Server using rsyslog.conf?.

Can I install Tesseract without cairo-devel?

No, cairo is a core rendering backend for Tesseract. Without cairo-devel, the compilation process will fail because Tesseract relies on Cairo for image processing and text recognition features.

What should I do if CentOS 8 reaches End of Life?

CentOS 8 has reached its end-of-life date. For long-term stability, consider migrating to Rocky Linux or AlmaLinux, which maintain compatibility with CentOS 8 packages but offer extended support lifecycles and active community maintenance.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More