3

The question unix.SE/3595 asks how to list packages that I explicitly installed. By explicit it means, packages that I choose, not including anything installed by default, or pulled in by the dependencies.

Is there a similar command to find packages that were explicitly removed?

n611x007
  • 1,007

3 Answers3

5

The following command will list all packages which have ever been removed (or purged), as far back as apt's history allows:

zgrep -E '^(Remove:|Purge)' /var/log/apt/history.log*

This does not distinguish automatic removals from explicit removals, but with a little work you should be able to reconstruct that information.

If you always use the command line, then

zgrep -E ^Commandline /var/log/apt/history.log*

will show you all the commands you issued, which will include explicit removals. You could filter it to only list remove or purge, but that won't include other forms of removals.

If you remove packages using dpkg, that won't appear in apt's logs; you'd need to look at /var/log/dpkg.log and search for remove or purge.

Stephen Kitt
  • 434,908
1

I don't know a way to do this using apt, but you may try searching your bash history:

grep 'apt-get .*remove' ~/.bash_history

This should output all lines with remove or autoremove.

MatthewRock
  • 6,986
0

There should be logs located at /var/log/apt/history.log that contain your past actions with apt.

chaos
  • 48,171
Centimane
  • 4,490