On a specific day, I installed lots of packages - that I didn't keep a good track of - on my Debian machine. Now I need to remove all this mess, because what I was trying to install simply didn't work at the end.

So I used this modified command

grep "2015-12-19.*.install " /var/log/dpkg.log | awk '{ print $4 }' | cut -d: -f1 | sudo apt autoremove -y

I got from this similar Ubuntu question. However, it doesn't seem to be removing all of the packages.

Is the used command above correct? Or which other command should I use?


The answer on AskUbuntu is fine, but in your case you need to use xargs and remove instead of autoremove:

grep "2015-12-19.*.install " /var/log/dpkg.log | \
awk '{ print $4 }' | cut -d: -f1 | xargs sudo apt remove -y
  • Thanks man. I'll try that and let you know. – AhmedWas Jan 14 at 10:27

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.