4

I am trying to clean my installation up a bit, so I decided to clean up my packages a bit. However, I'm having trouble with that: My wish is to make apt-get list all packages installed by me. If I list every package, I also see the dependencies of my packages although I am not interested in those. For example, I want to see that I installed lightyears but I do not want to see the packages installed alongside, like python-numpy or python-pygame. Is there a way to do this?

0

3 Answers 3

3

It's a quick hack, but this gets me very close:

manifest='http://releases.ubuntu.com/raring/ubuntu-13.04-beta2-desktop-amd64.manifest'

comm -2 -3 \
  <(apt-mark showmanual | sort) \
  <(curl --silent "$manifest" | grep --perl-regexp --only-matching '^[\w-.+]+' | sort)

You'll have to look up the package manifest for your version of Ubuntu from the releases server.

This method still returns a few packages that were selected via the Language Support installation prompt and the install third-party software checkbox, but depending on your needs it might be good enough.

0
3

I think there is no command that let you get that information directly, but you may get that information inspecting APT logs. APT stores a history of commands in /var/log/apt/history.log, with entries with the following format:

Start-Date: ** time when command was issued **
Commandline: ** command used **
Install | Upgrade | Remove: ** packages installed/upgraded/removed to satisfy the command **
End-Date: ** time when command have finished **

Commands typed by you should appear as you typed (so a sudo apt-get install numpy will appear as Commandline: apt-get install numpy). In my system the only other commands appearing in this log are from aptdaemon, that should be issued by Update Manager.

Please note that this log is rotated from time to time, so you may not have there all commands issued by you from the beginning, or you may need to extract a compressed part of it. Also if you have multiple users I think you will not be able to know which one installed what.

1
  • +1 for your answer! These logs are really awesome and yield more precise information than the accepted answer, howewer they only date back one week on my system, so it's not really usable for old systems (like mine). Apr 11, 2013 at 9:01
0

I'm trying this:

  1. go get the "manifest" file for your version as mentioned by ændrük above
  2. apt-mark showmanual to get a list of all packages apt-mark considers manually installed
  3. eliminate the dups between those lists, keeping the remainder of the output of apt-mark showmanual

I don't know if this really works, but it looks pretty likely to me. Any thoughts???

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .