Comment 6 for bug 61684

Revision history for this message
Michael Vogt (mvo) wrote : Re: Removing any u-desktop depdencency marks all other packages for auto-removal

I debugged the problem and it turns out that there is a bug in the new install-task code.

The reason is that TryToInstall() was used with BrokenFix=False. But unfortunately this mean in apt-speak that apt will fix any broken package automatically and this means that ones it encounters ubuntu-desktop it will auto-install all dependencies and mark those as auto-installed. Calling TryToInstall() with BrokenFix=True (newspeak!) means it won't autofix it and things work fine.

The fix is trivial (but too late for beta :(

--- cmdline/apt-get.cc 2006-09-19 15:22:41 +0000
+++ cmdline/apt-get.cc 2006-09-27 20:24:31 +0000
@@ -1440,7 +1440,7 @@
       buf[end-start] = 0x0;
       if (regexec(&Pattern,buf,0,0,0) != 0)
         continue;
- res &= TryToInstall(Pkg,Cache,Fix,false,BrokenFix,ExpectedInst);
+ res &= TryToInstall(Pkg,Cache,Fix,false,true,ExpectedInst);
       found = true;
    }

A workaround is to just empty /var/lib/apt/extended_states after the livefs build.