For the simplest example, if I want to remove two package, a and b. I do this:

sudo apt purge --autoremove package-a package-b

If ubuntu doesn't found package-a , it will stop and complain. How to let it automatically skip the package it can't find and just remove the ones it finds?

Suppose I have a lot of package to remove but I don't know which of them are actually in system, therefore I found skipping the "unfound" is very useful.


The method is to do it with:

dpkg --r package-a package-b

I found it here: https://superuser.com/questions/518859/ignore-packages-that-are-not-currently-installed-when-using-apt-get-remove .

| improve this answer | |
  • It will not work in package-a has other packages as dependency, those will remain, as it was indicated in a comment on that answer. The better way is this one superuser.com/a/725120/134448 – Anwar Aug 13 '16 at 13:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.