aptitude bug in specific version handling

Aptitude has an annoying bug, which will probably never be fixed upstream :( - but aptitude is the only tool that supports downgrading of package versions (with correct --force options) none-interactively (as done by f.ex. puppet).

If you want to install a package in a specific version (f.ex. for releasing site code in a specific version) - like this:

aptitude install site=$yourreleaseversion

and that version for some reason does not exist in the available repositories - aptitude will automaticly install the latest available version OR if that is already installed - just return 0 (OK) - and puppet thinks all is well :(

It has now annoyed me enough to write a patch:

--- aptitude-0.4.9.orig/src/cmdline/cmdline_action.cc   2007-11-16 06:07:58.000000000 +0100
+++ aptitude-0.4.9/src/cmdline/cmdline_action.cc 2010-08-05 13:35:25.000000000 +0200
@@ -85,6 +85,11 @@
if(action==cmdline_install)
ver=cmdline_find_ver(pkg, source, sourcestr);

+ if (!ver)
+ {
+ printf("Requested version not found in repositories: %s\n", sourcestr.c_str());
+ abort();
+ }
switch(action)
{
case cmdline_installauto:

This is ugly - but it works :)

2 comments on aptitude bug in specific version handling

  1. Anonymous
    Mon, 08/09/2010 - 15:55
    Have you reported a bug upstream?
  2. klavs
    Tue, 08/17/2010 - 22:44

    To both Ubuntu and Debian (which is probably the correct upstream). I've also attached my patch to the case.