Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

up vote 3 down vote accepted

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.

share|improve this answer
    
Works pretty well. Thank you! –  Max Beikirch Apr 11 '13 at 8:59

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.

share|improve this answer
    
+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). –  Max Beikirch Apr 11 '13 at 9:01

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???

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.