How to Delete Repos on CentOS

When working with software packages, you may find yourself in a position where you need to remove installed software packages and repositories. This may be the result of software no longer being needed for a given project, or it may be due to conflicts with other software that is installed. Fortunately, it is fairly simple to delete repositories in CentOS. For the purpose of this tutorial, we will be removing the EPEL repository that we initially installed.

Note that you will require root access in order to use these directions.

  1. First, connect to your CentOS server with root access via SSH.
  2. Next, search the for the package name installed by executing the following rpm command:
    rpm -qf /etc/yum.repos.d/epel.repo epel-release-6-8.noarch
  3. Once you’ve found the package name, remove the packages and repos with the following yum command:
    yum remove epel-release
  4. Finally, it is a good idea to run the following command to clear any cached data regarding the installed packages as this can take up a large amount of disk space.
    yum clean all

Congratulations! Now you know how to delete unneeded repos on your dedicated server!

Stormy Scott
Stormy Scott Content Marketing Writer

Stormy is a Content Marketing Writer at InMotion Hosting. Her content focus is WordPress, web design, and help articles for small businesses.

More Articles by Stormy

Was this article helpful? Let us know!