Centos – Removing yum repository in CentOS

centosyum

Webtatic has two yum repositories, one for CentOS 5 and one for 6. Both work on CentOS 6, but I'm having problems switching from the one to the other.

(Should you be interested in why I want to switch: a production server currently uses the former, but requires packages that only the latter provides.)

Installing the one repository provides a package called php54w:

rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
yum list php54w

(Output: php54w.x86_64 5.4.15-1.w6 webtatic)

After what I believe qualifies as removing the repository, the package is gone:

yum remove webtatic-release-6-3.noarch
yum clean all
yum list php54w

(Output: Error: No matching Packages to list)

Now the other repository can be installed:

rpm -Uvh http://mirror.webtatic.com/yum/centos/5/latest.rpm

But now, this repository provides the same php54w package, though that package doesn't exist in this repository:

yum list --enablerepo=webtatic list php54w

(Output: php54w.x86_64 5.4.15-1.w6 webtatic)

This seems to me like the previously installed repository is still being used somehow. How can I truly remove the previously installed repository?

(Thanks, Michael Hampton) No PHP package is installed during the test performed above.

The repositories have the same name, in the sense that they both exist in /etc/yum.repos.d/webtatic.repo.

Best Answer

Yum does a check on /etc/yum.repos.d/webtatic.repo to see if it has changed, but this appears to not be happening when this file is installed by the second rpm -Uvh command, and yum clean all does not stop this

Webtatic EL6:

-rw-r--r-- 1 root root 805 May 16 22:46 /etc/yum.repos.d/webtatic.repo

Webtatic 5:

-rw-r--r-- 1 root root 834 May 16 22:41 /etc/yum.repos.d/webtatic.repo

Perhaps this is because the Webtatic 5 package was built earlier than 6.

I could add to the build process something that would update the timestamp, however there was never any plan to have Webtatic 5 support CentOS 6, so you may get other unexpected results if you try to use it on that version.

A workaround for now would be to force Yum to spot the file has changed:

touch /etc/yum.repos.d/webtatic.repo