remove yum repo

How to Remove Yum Repositories

Yum is the default package manager for RHEL/CentOS/Fedora systems that allows you to install, update, remove packages in Linux. To do these things, yum refers to certain repositories of packages that are maintained by its package creators. When you try to install a package, yum will look for it in these repositories, download & install the nearest matching file from them. If it is unable to find the specified package, you may need to find & add the repository that actually provides this package. On the other hand, you may want to remove certain yum repositories if you feel you don’t need them or that they have become outdated. In this article, we will learn how to remove yum repositories.


How to Remove Yum Repositories

The simplest way to remove yum repository is to use yum-config-manager with –disable option, followed by the repository URL or name. Here is the command for it. You need to run this command as root user or user with sudo privileges.

yum-config-manager --disable repository

On the other hand, you can add a repository with the –add-repo option.

yum-config-manager --add-repo http://www.example.com/example.repo

If the above command does not work for you, go to /etc/yum.repos.d/ and delete the repository of your choice from that location.

Alternatively, you can find the repository name using grep command and use yum remove command to remove the repository. Here is an example to remove epel-release-5-4 repository.

$ grep epel
epel-release-5-4

$ yum remove epel-release-5-4
$ yum clean all

Please remember to use yum clean all so that yum does not continue installing from the deleted repository.

In this article, we have learnt several ways to remove yum repositories. You can try any of them as per your requirements.

Also read:

How to Undo or Redo Yum Install in RHEL/CentOS/Fedora
How to Fix Password Authentication Token Manipulation Error
How to Create Multiple User Accounts in Linux
How to Find PHP.ini
How to Delete Rows from Dataframe Based on Condition

Leave a Reply

Your email address will not be published. Required fields are marked *