How to remove all packages from specific repo without dependencies

Hamidreza picture Hamidreza · Aug 26, 2014 · Viewed 27.6k times · Source

I know following code will remove all package from specific repo.

yum remove $(yum list installed | grep rpmforge | awk '{ print $1 }')

And following code will remove a package without dependencies.

rpm -e --nodeps "php-sqlite2-5.1.6-200705230937"

But i don't know how to use together.

Answer

czerny picture czerny · Mar 25, 2015

Print list of all repositories to get repo id (first column):

$ dnf repolist

Now remove all packages of selected repo:

# dnf repository-packages <repo-id> remove

See repository-packages section of dnf manual page for details regarding manipulation with all packages in specific repository.