Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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. –  Bruce Connor Nov 2 '12 at 11:54

2 Answers 2

up vote 1 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? –  Bruce Connor 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. –  Bruce Connor 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

Your Answer

 
discard

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.