Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove all packages from specific repo without dependencies

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.

like image 636
Hamidreza Avatar asked Aug 26 '14 07:08

Hamidreza


People also ask

How do I uninstall a package without dependencies?

The first “rpm -qa” lists all RPM packages and the grep finds the package you want to remove. Then you copy the entire name and run the “rpm -e –nodeps” command on that package. It will, without prompting for confirmation, remove that package but none of its dependencies.

Does yum remove dependencies?

From now, every time you remove a packages, YUM goes through each package's dependencies and remove them if they are no longer needed by any other package.


2 Answers

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.

like image 192
czerny Avatar answered Sep 21 '22 08:09

czerny


Try the following command:

rpm -e --nodeps `yum list installed | grep rpmforge | awk '{ print $1 }'` 
like image 35
robinwen Avatar answered Sep 19 '22 08:09

robinwen