Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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

Some times I manually install some '.deb' files using dpkg -i *.deb and the apt get broken. So I want to undo last (sometime more) operation. How can I do it

share|improve this question

A simple way of undoing apt actions

To install, open up a Terminal window, and type in it:

sudo add-apt-repository ppa:lkjoel/apt-undo && sudo apt-get update; sudo apt-get install apt-undo

Usage examples:

apt-undo install yourpackages
apt-undo remove yourpackages
apt-undo purge yourpackages
apt-undo safe-upgrade
apt-undo full-upgrade
apt-undo install yourpackages=old.version
apt-undo install yourpackages=new.version

To undo:

apt-undo undo   

apt-undo undo $HOME/.aptundo/year/month/date/yearmonthdatehourminutesseconds Or
bash $HOME/.aptundo/year/month/date/yearmonthdatehourminutesseconds

share|improve this answer

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.