Ubuntu – How to reinstall recently removed softwares

software installation

While installing some softwares, the system removed several softwares automatically. And I also found out newly installed softwares are almost useless to me. So I want to revert to the last state(that is, remove the newly installed softwares and install the recently removed softwares). Because there are many softwares in question, so I don't want to do it one by one. Is there any method to do the trick conveniently?

Best Answer

Try the below:

cat /var/log/apt/history.log | grep 'apt-get remove' | cut -d" " -f4 | xargs apt-get install

What it does is, list all the packages that have been removed using 'apt-get remove' and then attempts to install them one by one. You might also want to rerun this using 'purge' instead of 'remove'.

Note that, this will install ALL applications you have removed so far, not just the recent ones. You can edit the history.log file to remove old entries and keep only the "recent" ones

Related Question