Convert RHEL-7 to CentOS

St 02 května 2018

I have tried to suggest update of Migration Guide for RHEL7→CentOS7 migration, but apparently after CentOS was bought by Red Hat, there is not enough desire to document such migration, ehm ehm. So, just recording this for posteriority:

URLBASE=http://mirror.centos.org/centos/7/os/x86_64/Packages
cd /tmp
mkdir TMP
cd TMP
wget $URLBASE/centos-indexhtml-7-9.el7.centos.noarch.rpm \
    $URLBASE/centos-release-7-4.1708.el7.centos.x86_64.rpm \
    $URLBASE/yum-3.4.3-154.el7.centos.noarch.rpm \
    $URLBASE/yum-plugin-fastestmirror-1.1.31-42.el7.noarch.rpm
subscription-manager remove --all
yum remove rhnlib abrt-plugin-bugzilla redhat-release-notes\* \
    subscription-manager\*
rpm -e --nodeps redhat-release-workstation redhat-indexhtml
for dir in /usr/share/redhat-release\;\* ; do rm -fv $dir ; done
rmdir /usr/share/redhat-release
rpm -Uvh *
yum clean all && rm -rf /var/cache/yum
yum upgrade
yum upgrade
yum distro-sync
package-cleanup --orphans
cd .. && rm -rf TMP

I am not sure what’s the deal with /usr/share/redhat-release*, but it is just necessary to get rid of all variants of such directory.

Category: computer Tagged: linux