Server Fault is a question and answer site for system and network administrators. 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 a CentOS box where I installed an external repository and added some software, mostly java related.

Now I want to get back to the initial repository (only CentOS Base) and remove all the software installed from it. Is there anyway I can easily do this ? I already know how to remove a repository but this will not remove the installed software.

share|improve this question
up vote 0 down vote accepted

Try this before you remove the repository:

yum list installed | grep [reponame]

Be aware, however, that this will only show packages which were most recently installed by the repository in question. If the package was updated with a version from another repository, it will not show up.

share|improve this answer


Want to query all those packages installed from 3rd party repositories, not CentOS?

rpm -qa --qf '%{NAME} %{VENDOR}\n' | grep -v CentOS

Change that to grep for the repo you want to get rid of, that way you get a list of all the packages.
Then loop over that list and remove them.
I don't know of any easier way.

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.