Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have no root access on my machine at work, but I have sudo permission to use sudo yum (and only yum).

Recently I accidentally installed a faulty repository (dropbox), and now I'd like to remove it. Since I have no write access to the yum.repos.d directory, manually editing or removing the repo file is out of the question.

I know you can install repos using yum (it's what I did), but can you remove a repo using yum?

Using Scientific Linux 6.

By the way, I know I can yum --disablerepo= to ignore the problematic repo. But I would like to remove it for good, because it's also causing problems with the graphical package manager (it keeps popping up notifications saying the updates couldn't be retrieved).

share|improve this question
I also know how to fix the problematic repo. So a way of just overwriting it is also welcome. – Malabarba Nov 2 '12 at 11:54
up vote 2 down vote accepted

you can remove the repo with yum-config-manager but not with yum:

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

EDIT: you need some way of running this as root (ie. sudo)

share|improve this answer
Isn't -e for removing packages? – Malabarba Nov 2 '12 at 12:05
youre right, i havent had my coffee yet... – h3rrmiller Nov 2 '12 at 12:22
i changed it, do not multitask before ingesting coffee – h3rrmiller Nov 2 '12 at 12:27
Ok, thanks. I'll wait around a bit more, but I might just boot up a live CD and remove the repo file. I didn't want to "hack" anything =P, but it's for a good reason. – Malabarba Nov 2 '12 at 12:44
if your sudoers line is just yum (and not the full path) you could copy /bin/bash to your working directory, prepend . to your PATH (export PATH=.:$PATH) and sudo yum that will fork a bash with root privs for you – h3rrmiller Nov 2 '12 at 14:09

You can temporarily remove/disable a yum repo by adding the --disablerepo=(reponame) to your yum line.

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

Unfortunately, that's the only way to do it with yum/sudo

share|improve this answer
he already established that he knew how to do that (the italicized text at the bottom of his question) – h3rrmiller Nov 5 '12 at 21:13

In order to remove the actual yum repository rather than just to disable it, you have to find the package and remove it.

rpm -qa | grep epel

Sample outputs:

yum remove epel-release-5-4
yum clean all
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.