How to Find CentOS Package Lists and Versions Online Before Installation


2 views

When migrating from Ubuntu to CentOS, understanding package availability and versions is crucial for compatibility planning. Unlike Ubuntu's apt repositories which are easily browsable online, CentOS requires some different approaches to examine packages without a live system.

The CentOS project provides several ways to explore packages:

CentOS repositories contain XML metadata files that list all available packages. You can parse these directly:

# Sample command to view package list from a mirror
curl -s https://mirror.centos.org/centos/7/os/x86_64/repodata/primary.xml.gz | gunzip | grep -E '<name>|<version'

Several websites provide package search capabilities:

Here's a Python script to compare package availability between Ubuntu and CentOS:

import requests

def check_package(pkg_name):
    centos_url = f"https://centos.pkgs.org/search/?search={pkg_name}"
    ubuntu_url = f"https://packages.ubuntu.com/search?keywords={pkg_name}"
    
    print(f"CentOS: {centos_url}")
    print(f"Ubuntu: {ubuntu_url}")

check_package("nginx")
check_package("php-fpm")

Key web server packages that often differ between Ubuntu and CentOS:

Package Ubuntu Name CentOS Name
Apache apache2 httpd
PHP php7.4 php
MySQL mysql-server mariadb-server

Remember that CentOS typically uses older, more stable versions compared to Ubuntu's newer releases. Always verify version compatibility for your applications.


When migrating from Ubuntu to CentOS, examining package availability beforehand is crucial. Here are authoritative online sources for CentOS package metadata:

# Primary mirror structure (replace $VERSION):
https://vault.centos.org/$VERSION/os/x86_64/Packages/
https://vault.centos.org/$VERSION/updates/x86_64/Packages/

For CentOS 7 specifically:

https://vault.centos.org/7.9.2009/os/x86_64/Packages/

Use this Python script to fetch package lists via HTTP:

import requests
from bs4 import BeautifulSoup

def get_centos_packages(version='7'):
    base_url = f"https://vault.centos.org/{version}/os/x86_64/Packages/"
    response = requests.get(base_url)
    soup = BeautifulSoup(response.text, 'html.parser')
    return [a['href'] for a in soup.find_all('a') if a['href'].endswith('.rpm')]

print(get_centos_packages('7.9.2009')[:10])  # Sample output

Key differences in common web server packages:

Function Ubuntu Package CentOS Equivalent
Web Server apache2 httpd
PHP php7.4 php
Database mysql-server mariadb-server

For EPEL repositories (common for web applications):

https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
https://mirrors.edge.kernel.org/fedora-epel/7/x86_64/Packages/

For automated comparison between systems:

# Ubuntu to CentOS mapping example
package_map = {
    'apache2': 'httpd',
    'libapache2-mod-php': 'mod_php',
    'python3-pip': 'python3-pip'
}

def convert_package(pkg_name):
    return package_map.get(pkg_name, pkg_name)