How to Remove EPEL 7 Repository and Install EPEL 6.8 on CentOS 6.5 for PHP 7.2 Upgrade


2 views

When attempting to upgrade PHP from 5.4 to 7.2 on CentOS 6.5, you might encounter dependency issues like:

Error: Package: libcurl-7.29.0-59.el7.x86_64 (epel)
       Requires: libssl.so.10(OPENSSL_1.0.1)(64bit)

This indicates your system is mistakenly trying to use EPEL 7 packages on CentOS 6. Let's verify the installed EPEL repo:

# List all enabled repositories
yum repolist enabled

# Check EPEL package version
rpm -qa | grep epel-release

First, remove the incorrect EPEL 7 repository:

# Remove EPEL 7 package
yum remove epel-release

# Clean YUM cache
yum clean all

Verify the removal by checking if any EPEL repositories remain:

ls -la /etc/yum.repos.d/epel*

Now install the correct EPEL 6.8 repository for CentOS 6:

# Download EPEL 6 release package
wget https://archive.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

# Install the package
rpm -ivh epel-release-6-8.noarch.rpm

# Verify installation
rpm -qa epel-release

With the proper repository in place, you can now proceed with the PHP upgrade:

# Install the Remi repository for PHP 7.2
rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-6.rpm

# Enable PHP 7.2 repository
yum-config-manager --enable remi-php72

# Install PHP 7.2 and required extensions
yum install php php-cli php-common php-mysql php-gd php-mbstring

Verify the PHP version:

php -v

If you encounter dependency problems after these steps:

# Resolve dependencies
yum deplist php

# Check for package conflicts
package-cleanup --dupes
package-cleanup --problems

Ensure all repositories are properly configured:

# Check enabled repositories
yum repolist enabled

# Verify repository priorities
yum install yum-plugin-priorities

This complete process should resolve your EPEL repository mismatch and allow successful PHP 7.2 installation on CentOS 6.5.


When attempting to upgrade PHP from 5.4 to 7.2 on CentOS 6.5, you might encounter dependency conflicts caused by an incorrectly installed EPEL 7 repository. The system may show errors related to libcurl or other packages trying to pull dependencies from EPEL 7 instead of EPEL 6.8.

First, verify which EPEL repositories are currently installed on your system:

yum repolist | grep epel
rpm -qa | grep epel-release

This will show you all enabled EPEL repositories. If you see "epel-release-7" or similar, it indicates EPEL 7 is installed.

To cleanly remove the EPEL 7 repository:

yum remove epel-release
rpm -e epel-release-7*
rm -f /etc/yum.repos.d/epel*
yum clean all

This sequence ensures complete removal of all EPEL 7 packages and cached data.

Now install the correct EPEL version for CentOS 6:

rpm -Uvh https://archives.fedoraproject.org/pub/archive/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum clean all
yum makecache

Verify the installation:

yum repolist | grep epel
cat /etc/yum.repos.d/epel.repo

With the correct repository in place, you can now proceed with the PHP upgrade:

yum install https://rpms.remirepo.net/enterprise/remi-release-6.rpm
yum --enablerepo=remi-php72 install php php-common php-opcache php-mcrypt php-cli php-gd php-curl php-mysql

Check the PHP version to confirm:

php -v

To ensure all future installations come from the correct repositories:

yum install yum-plugin-priorities
Edit /etc/yum.repos.d/epel.repo and add:
priority=10

This gives EPEL 6.8 lower priority than base repositories.

If you encounter dependency problems after the repository change:

package-cleanup --problems
package-cleanup --dupes
yum-complete-transaction

These commands help resolve leftover dependency issues from the repository change.