I don't believe that there is such an option with aptitude
or apt-get
. However, aptitude
keeps an excellent, clear log at /var/log/aptitude.You can use that to attempt rollbacks.
How well it will go will depend on the exact situation. If you merely want to remove a few packages you've installed, it should be trivial. But if you've upgraded (either because you follow testing or unstable or because you installed a security upgrade or point-release upgrade), then things are a bit more complicated. You can check if you still have the older .deb in your cache, or you can visit Debian snapshot.
If you don't use aptitude
, you can poke around in dpkg
's log (at /var/log/dpkg.log
), but I find that a lot less friendly to work with.
Edit Now that I look at the article, there is one thing that is somewhat similar. You can get the state of your packages by doing this sequence. First get a list of the current package state:
dpkg --get-selections "*" > my_packages-datestamp
Then later you could rollback by using that package list:
dpkg --set-selections < my_packages-datestamp
apt-get -u dselect-upgrade
I've used this method to reinstall and then have exactly the current set of packages on the machine, and it's worked well. Again, though, how well it works will depend on what packages from the previous package list are available to you - either in your cache or in your repos.