CentOS / RHEL: Delete Old Yum Repositories and Configuration Files

w‮tual.ww‬turi.com
CentOS / RHEL: Delete Old Yum Repositories and Configuration Files

To delete old Yum repositories and configuration files on CentOS or RHEL, you can use the following steps:

  1. List the available repositories on your system by running the following command:
yum repolist

This will display a list of the repositories that are currently configured on your system.

  1. To delete a repository, you can use the yum-config-manager command with the --disable option and the name of the repository. For example, to delete the epel repository:
sudo yum-config-manager --disable epel

This will disable the repository, which will prevent it from being used for package installations or updates.

  1. To completely remove a repository and its configuration files, you can use the rm command to delete the repository configuration file from the /etc/yum.repos.d/ directory. For example, to delete the epel repository:
sudo rm -f /etc/yum.repos.d/epel.repo

This will delete the repository configuration file and remove the repository from your system.

  1. Repeat steps 2 and 3 for each repository that you want to delete.

After deleting the repositories and their configuration files, the packages from those repositories will no longer be available for installation or update on your system.

It's a good idea to periodically review and clean up your repositories to ensure that you are only using the repositories that you need, and to remove any unused or obsolete repositories. This can help improve the performance and reliability of the yum package manager on your system.

Created Time:2017-10-16 14:38:41  Author:lautturi