Saturday, March 24, 2007

yq: a stack for package transactions

yq is a little command line program I've been coding up over the past week to solve a specific problem I encounter quite regularly. Often I will install a program via yum to try it out, only to decide I don't like it. The problem occurs when the installed program brings in dependencies; if you want these removed along with the program, you'll need to remember all of them. So, my frequent testing of programs results in a lot of built-up cruft on my machine.

A solution to this problem are rollbacks. rpm does have built-in rollback support. I am not interested in saving all of the previously installed rpms on my disk when I install or upgrade something new, nor am I interested in saving each and every rpm transaction.

yq leverages yum to perform transaction rollbacks and replays. Since the rpms you are dealing with are already in a yum repository, yq only records the names of these rpms.

The design for yq is influenced by patch management programs like quilt, which is where the stack comes into play. Transactions that you create can be pushed and popped onto/off of the stack, changing the state of your system.

You can download yq, or browse the sources via gitweb.


  1. Why not use "yum remove "? i.e. yum remove f-spot it will remove any dependencies that aren't needed by anything else. If they were brought in by f-spot, they will get removed.

  2. > If they were brought in by f-spot, they will get removed.

    No, they won't.

    Though this is another idea I've been kicking around; a plugin that will run down your dep tree when you remove something and pull out anything that's no longer required. I'm happy with yq for now, since this way I don't even have to remember the name of any package at all.


© 2012 James Bowes. Icons by glyphicons. Powered by Blogger.