Take the 2-minute tour ×

I used to install packages by dpkg -i *.deb as I have all deb (with dependencies) in one folder.

Now Is there any Reverse process of dpkg -i *.deb to remove all packages installed from debs.

(dpkg -r <pkgname>is not helpful because it requires package-name instead of deb file and not accept *.deb)

share|improve this question

1 Answer 1

up vote 2 down vote accepted

dpkg can extract the package name (with a bit of help). The only serious problem here is just chaining them together and that's where find steps in.

apt-get remove `find -iname '*.deb' -exec dpkg --info '{}' \; | awk '/Package:/ {print $2}'`

That isn't tested but it should work.

share|improve this answer
I tried This and It's Working But dpkg shows error while removing some packages if other packages depends on them. So. I tried "apt-get remove" Instead of "dpkg" -r in that folder Containing Deb's. And It's Working Well. –  Pandya Apr 9 at 12:24
@Pandya I noticed your edit bounced. Sorry about that. I've altered my answer to account for your comment. –  Oli Apr 9 at 13:11

Your Answer


