Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was trying to get musepack encoder support built into ffmpeg today, and I inadvertently broke a few things but I'm not sure exactly which package I installed which broke them. How can I remove ALL packages I installed today, and start again from scratch more carefully?

I can see a list of them in "Ubuntu Software Center" under today's date in the "History", but I don't want to go through uninstalling them one-by-one, because there are hundreds to do.

share|improve this question
up vote 5 down vote accepted

The file /var/log/apt/history.log has what you need. Take a look at the answer: How to reinstall many removed packages at once? it's a more detailed answer.

share|improve this answer
grep -e `date +%Y-%m-%d` /var/log/dpkg.log | awk '/install / {print $4}' | uniq | xargs apt-get -y remove

found on commandlinefu worked fine for me

share|improve this answer
This will remove only packages installed by dpkg, not by apt. – Pilot6 May 30 '15 at 11:33
I just tested the grep -e `date +%Y-%m-%d` /var/log/dpkg.log | awk '/install / {print $4}' | uniq output, was exactly the packages I installed using apt-get today!! nice script buddy, +1. – dariush Jan 8 at 17:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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