7

How do I see a list of packages I manually (really manually, as in I typed them in) installed?

I want to exclude packages that were installed as a result of being dependencies of other packages that I manually typed in.

For example, if I ran the command:

sudo apt-get install mysql-server

and as a result mysql-common was installed, I want to only see mysql-server in the list and not mysql-common.

I've searched for an answer and found many that were close but not exactly what I want.

1

3 Answers 3

17

It's much better to use apt-mark tool:

apt-mark showmanual

This is exactly what you want. You also can mark packages as manually installed or not and hold the packages on fixed versions.

3
  • 1
    This shows dependencies installed along with the manually installed packages.
    – To Do
    Apr 18, 2014 at 8:45
  • This should be the accepted answer
    – geotheory
    May 7, 2016 at 10:18
  • 3
    @ToDo, is it? Or is it listing packages "manually" installed during OS installation? I saw a lot of packages that I didn't explicitly install but I thought they were "manually" installed when I installed the OS. Nov 22, 2016 at 23:07
8

That do what you want:

cat /var/log/apt/history.log | grep -E 'apt(-get)? install '
4
  • That's a very clever answer. The only flaw is the history is limited because of log rotation. This solution would be more robust if you went into the archived logs and pulled out those log entries as well. That being said, your idea sounds great. Thanks.
    – user92125
    Oct 4, 2012 at 0:30
  • To accommodate log rotation you can search old log files too. Use $ zcat /var/log/apt/history.log.*.gz | grep 'apt-get install'
    – kaapstorm
    Nov 16, 2013 at 17:12
  • zcat /var/log/apt/history.log.*.gz | grep 'apt-get install' did give me a list of things I installed but surely not the whole list.
    – To Do
    Apr 18, 2014 at 8:43
  • Or, if you use apt to install things: cat /var/log/apt/history.log | grep 'apt install '
    – nnyby
    Mar 22, 2016 at 17:02
0

I've built a script using the idea of wojox. It creates file in your home directory with all packages in it.

https://github.com/PaperMountainStudio/list-manually-installed-packages

You must log in to answer this question.