DNFRepo List Returns Different Responses: CentOS 9 Stream and Zotac

Abstract: Resolve DNF repolist discrepancies on Zotac hardware by correcting base URLs and enabled settings in /etc/yum.repos.d/ files.

Created: 2026-10-13 by
The DNF repo list discrepancy between CentOS 9 Stream and Zotac hardware is typically caused by repository configuration mismatches or missing base URLs in the .repo files, not hardware limitations. When Ansible playbooks fail to locate packages on Zotac systems, it often indicates that the target machine lacks valid enabled repositories or has incorrect mirror settings. Verifying the content of /etc/yum.repos.d/ and ensuring baseurl entries are correct resolves most identification issues without requiring complex troubleshooting steps.

Understanding the Repository Environment

Before diving into fixes, it is crucial to understand how DNF identifies available software sources. The command dnf repolist queries the metadata stored in files located within the /etc/yum.repos.d/ directory. Each file ending in .repo defines a specific repository, including its name, base URL for downloading packages, and whether it is enabled by default. When you run this command on a CentOS 9 Stream system, you expect to see standard repositories like BaseOS, AppStream, and potentially EPEL if installed. If the output differs significantly on a Zotac machine, the issue is almost certainly not with the Zotac hardware itself, but rather with the state of the operating system installation or the configuration files. Hardware vendors do not alter package management tools; they provide the physical infrastructure. Therefore, assuming the problem lies with the "Zotac" aspect is a common misconception. The focus must remain on the Linux distribution's configuration.

Checking Enabled Repositories

To diagnose the immediate symptom, run the following command on both systems:
dnf repolist --all
This displays all configured repositories, including those currently disabled. Compare the output between the CentOS 9 Stream node and the Zotac node. Look for differences in the enabled column. If critical repositories like appstream are listed as disabled, DNF will not search them for packages, leading to the "package not found" errors seen in your Ansible playbooks.

Verifying Configuration Files

The core of the problem usually resides in the .repo files. On CentOS 9 Stream, these files should point to official Fedora/CentOS mirrors or local vaults if offline. A common error occurs when copy-pasting configurations results in malformed URLs or typos in the baseurl field. Inspect the contents of your repository files using a text editor such as vi or nano:
cat /etc/yum.repos.d/CentOS-Stream-BaseOS.repo
Ensure that the baseurl directive points to a valid HTTPS or HTTP endpoint. For example, it might look like http://mirror.centos.org/centos/9/BaseOS/$basearch/os/. If the URL is incorrect or unreachable, DNF cannot fetch metadata, causing the repolist to appear empty or incomplete. Do not assume that Zotac machines require different URLs; they should use the exact same repository definitions as any other x86_64 CentOS 9 system.

Common Pitfalls in Repo Files

Several syntax errors can break repository detection:
  • Missing Semicolons: While modern DNF is forgiving, some older scripts rely on strict formatting.
  • Incorrect Variables: Ensure $releasever and $basearch are correctly expanded. You can test expansion by running echo $releasever in the shell.
  • Disabled by Default: Check the enabled=0 line. If set to 0, the repo is ignored unless explicitly called.
If you suspect the configuration is corrupted, comparing it against a known good CentOS 9 Stream template is more effective than guessing new URLs. For historical context on maintaining older systems where repo structures were different, you might find relevant insights in Maintaining CentOS 7 Past EOL, although CentOS 9 uses a different structure entirely.

Ansible Integration Challenges

Since your workflow involves Ansible playbooks, the DNF module relies on the underlying OS having a functional DNF environment. If the playbook fails to install a package, it is likely because DNF returns an error code due to the repo issues described above. To debug Ansible-specific failures, enable verbose logging:
ansible-playbook -v site.yml
Look for lines indicating Failed to download metadata for repo '...'. This confirms that the network or configuration path is broken. It does not mean the package is unavailable globally, only that this specific host cannot reach the repository index. Ensure that your Ansible inventory variables do not override necessary repository settings unless intentionally intended for a custom local mirror setup.

Testing Package Availability Locally

Before running full playbooks, test package availability directly on the Zotac machine via SSH:
dnf search 
If this search returns no results, the issue is definitively at the OS level, not Ansible. If it finds the package, then the issue may lie in how Ansible invokes the DNF module or if there are conflicting dependencies defined in your playbook.

Resolving Metadata Issues

Sometimes, the repository files are correct, but the cached metadata is stale or corrupted. This can happen after network changes or mirror updates. Clearing the cache forces DNF to re-download fresh metadata from the source. Execute the following commands to clean the cache and regenerate it:
dnf clean all
dnf makecache
After running makecache, verify that the repolist populates correctly. This step alone resolves many intermittent "repo list returns different responses" issues where one machine works and another does not, due to divergent cache states. For users dealing with older systems that have reached End of Life, finding working mirrors becomes harder, as discussed in Centos 7 yum update issue - Troubleshooting Guide. However, CentOS 9 Stream is active, so standard public mirrors should always work if configured correctly.

Network and Firewall Considerations

In enterprise environments, firewalls may block access to certain package mirrors. If the Zotac machine is behind a restrictive proxy or firewall, it might be unable to reach the CentOS mirrors while the CentOS 9 Stream reference machine (perhaps on a different network segment) can. Check outbound connectivity using curl or wget:
curl -I http://mirror.centos.org/centos/9/BaseOS/x86_64/os/repodata/repomd.xml
If this request times out or returns a 403 Forbidden error, the network layer is blocking DNF. Configure your DNF proxies in /etc/dnf/dnf.conf if required:
proxy=http://your-proxy-server:port
Ensure that the Zotac machine has the same network permissions as the working CentOS system.

Frequently Asked Questions

Why does dnf repolist show different numbers on two identical systems?

Differences in the repolist count usually indicate that one system has additional repositories enabled, such as EPEL or third-party repos, while the other does not. It can also result from one system having a corrupted cache that needs cleaning. Always compare the --all flag output to see hidden disabled repos.

Can I use the same .repo files from CentOS 7 on CentOS 9?

No, CentOS 7 and CentOS 9 use completely different directory structures and repository naming conventions. CentOS 7 uses yum and distinct repo names like extras, while CentOS 9 uses dnf with BaseOS and AppStream. Attempting to mix them will cause dependency conflicts and installation failures.

What if my Zotac machine cannot connect to the internet?

If the machine is air-gapped, you must configure local repositories. This involves mounting a local ISO or copying the repodata folder to a local web server or NFS share, then updating the baseurl in the .repo file to point to that local path instead of the public internet.

Does Ansible ignore DNF errors silently?

No, Ansible reports failures clearly in its output. If a package installation fails, Ansible marks the task as failed and provides the stdout/stderr from the DNF command. If you see no error, check if the package was already installed and the task was marked as skipped due to idempotency checks.

How do I fix a "Cannot retrieve metalink" error?

This error typically occurs when the primary mirror is down or unreachable. You can resolve it by editing the .repo file to remove the metalink line and replace it with a direct baseurl to a reliable mirror, or by running dnf clean all to force a refresh of available mirrors.

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