Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

2 Answers 2

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

See http://wiki.centos.org/TipsAndTricks/YumAndRPM:

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

 
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.