Allen Lin
Allen Lin

Reputation: 1209

How to remove yum repositories

(This seems to be a rather straightforward question but I can't find the answer on SOF. Let me know if I missed a post and I will delete this!)

Hello! How to delete the repositories that are listed in yum repolist?

For example, when I ran yum reoplist, I got (for example): repo id repo name pgdg93/7Server/x86_64 PostgreSQL 9.3 7Server - x86_64

But man yum does not tell me how to remove the repo if they are no longer in use (e.g. ). I tried sudo yum-config-manager --disable pgdg93/7Server/x86_64 but the result of yum repolist is the same. Btw, this repo is installed through rpm install [url]

Thanks!

Upvotes: 2

Views: 33658

Answers (2)

Sachin
Sachin

Reputation: 1704

We have multiple ways to do the same.

  1. You may be able to go into /etc/yum.repos.d/ and remove the file corresponding to the repository.

  2. You can also try to remove the repo and add with yum-config-manager

yum-config-manager --disable repository

yum-config-manager --add-repo http://www.example.com/example.repo
  1. You can temporarily remove/disable a yum repo by adding the --disablerepo=(repo name) to your yum line.

yum --disablerepo=some-repository install some-package

Upvotes: 0

Aaron D. Marasco
Aaron D. Marasco

Reputation: 6758

It's either a file in /etc/yum.repos.d/ (new way) or an entry in /etc/yum.conf (old way). See https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/sec-Configuring_Yum_and_Yum_Repositories.html for details.

Upvotes: 5

Related Questions