I manage my packages with aptitude.

I occasionally go through my list of packages, removing obsolete applications (in the sense that I do not want to use them any more).

For example, while I have a limited number of development libraries on my system that I do want installed permanently, a lot were just there to allow me to compile some program from source once, and a long time ago. To make those clean-up sessions take unneeded dependencies into account, I use the markauto command of aptitude.

The problem is that I sometimes can no longer trust my memory to make the difference between packages that are transient, and things that I need to keep (because, e.g., I will need them to recompile something tomorrow). The situation is even more acute when I share administration duties over a server with another admin. Alternatively, I wish I would have the discipline to clean up all packages that are transient after use, but history proves it's too much to hope for.

Hence : is there a tool that, like markauto would let me annotate packages at installation time, not with a flag but with a simple comment string saying why they are being installed?

Ideally, that comment would be retrievable with aptitude (or synaptic, or whatever kids these days use to manage packages). Ideally, this would be something that me and another admin on the same server can collaborate on, and it would thus, for example, benefit from the same lock-management system as the package-tree already has.


Aptitude supports "user tags", see if they meet your requirements.

   add-user-tag, remove-user-tag
       Adds a user tag to or removes a user tag from the selected group of
       packages. If a package name contains a tilde ("~") or question mark
       ("?"), it is treated as a search pattern and the tag is added to or
       removed from all the packages that match the pattern (see the
       section "Search Patterns" in the aptitude reference manual).

       User tags are arbitrary strings associated with a package. They can
       be used with the ?user-tag(<tag>) search term, which will select
       all the packages that have a user tag matching <tag>.

Also see the options --add-user-tag, --add-user-tag-to, --remove-user-tag, --remove-user-tag-from. One example usage:

aptitude install cinnamon --add-user-tag "for=cinnamon; date=$(date)"

Nevertheless, I fear they are only visible/usable through aptitude.

  • Yes ! This is perfect ! Notable points : the user-tag is retrievable through aptitude show, displayed in the aptitude info dialog, and can be an arbitrary long string (with spaces, etc) – huitseeker Aug 24 '11 at 16:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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