Hit this a good number of time today; sometimes happens when aptitude installs build-deps, sometimes when pbuilder calls apt-get install fakeroot, sometimes not at all. I did not manage to strace a broken apt-get, so it could very well be a race condition.
Since the ouput is broken between apt-get's output and dpkg output, my best suspect so far is APT's terminal handling, perhaps in this code: // if tcgetattr does not return zero there was a error // and we do not do any pty magic if (tcgetattr(0, &tt) == 0) { ioctl(0, TIOCGWINSZ, (char *)&win); if (openpty(&master, &slave, NULL, &tt, &win) < 0) { const char *s = _("Can not write log, openpty() " "failed (/dev/pts not mounted?)\n"); fprintf(stderr, "%s",s); fprintf(term_out, "%s",s); master = slave = -1; } else { struct termios rtt; rtt = tt; cfmakeraw(&rtt); rtt.c_lflag &= ~ECHO; // block SIGTTOU during tcsetattr to prevent a hang if // the process is a member of the background process group // http://www.opengroup.org/onlinepubs/000095399/functions/tcsetattr.html sigemptyset(&sigmask); sigaddset(&sigmask, SIGTTOU); sigprocmask(SIG_BLOCK,&sigmask, &original_sigmask); tcsetattr(0, TCSAFLUSH, &rtt); sigprocmask(SIG_SETMASK, &original_sigmask, 0); ... -- Loïc Minier -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org