Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Apt keeps crashing when I try to run

apt-get upgrade

xxx@xxx:/root/# sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
  linux-generic linux-headers-generic linux-image-generic
The following packages will be upgraded:
  cvs dovecot-common dovecot-pop3d language-pack-en language-pack-en-base
  language-pack-gnome-en language-pack-gnome-en-base libgssapi-krb5-2
  libk5crypto3 libkrb5-3 libkrb5support0 libssl0.9.8 login openssl passwd
15 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
1 not fully installed or removed.
Need to get 0B/14.9MB of archives.
After this operation, 3,731kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Preconfiguring packages ...
(Reading database ...
dpkg: warning: files list file for package `cvs' missing, assuming package has no files currently installed.
(Reading database ... 141611 files and directories currently installed.)
Preparing to replace cvs 1:1.12.13-12ubuntu1 (using .../cvs_1%3a1.12.13-12ubuntu1_amd64.deb) ...
Unpacking replacement cvs ...

And it just hangs there :(, CTRL+C does nothing I've drive killing dpkg and apt afterwards with

sudo killall -9 dpkg
sudo killall -9 apt-get

but dpkg remains running :(

I managed to kill all processes at one point and tried to remove cvs (thinking that was the problem but I had no luck).

share|improve this question
    
dpkg-reconfigure debconf and setting the priority to medium try that –  pablo Feb 18 '11 at 10:22
    
use kill -9 <pids> to kill everyone and try again. –  coredump Feb 18 '11 at 10:23

3 Answers 3

up vote 2 down vote accepted

Try this,

when you gt stuck in that situation background current process with CTRL+Z

that should give you shell again.

then do pgrep dpkg | xargs kill -9 # kill all processes matching string dpkg

pgrep apt-get | xargs kill -9 # kill all processes matching string apt-get

dpkg --purge cvs # remove currently installed cvs package

apt-get update # update package lists from your apt repositories

apt-get install cvs # install cvs package from the updated repositories

share|improve this answer
    
xxx@xxx:~# dpkg --purge cvs dpkg: error processing cvs (--purge): Package is in a very bad inconsistent state - you should reinstall it before attempting a removal. Errors were encountered while processing: cvs –  glisignoli Feb 18 '11 at 11:13
    
try "aptitude reinstall cvs" –  Hrvoje Špoljar Feb 18 '11 at 11:15
    
hmm I don't think cvs is the problem now. I managed to remove cvs with: "sudo apt-get --purge remove --force cvs" but after trying a apt-get upgrade. It stalled on "Unpacking replacement login ..." –  glisignoli Feb 18 '11 at 11:19
    
Ah and those commands arn't killing my dpkg processes. Weird... –  glisignoli Feb 18 '11 at 11:26
    
and finally: "xxx@xxx:~# ps -aef |grep dpkg" tells me: root 11983 1 0 Feb16 ? 00:00:00 /usr/bin/dpkg --status-fd 25 --unpack --auto-deconfigure /var/cache/apt/archives/cvs_1%3a1.12.13-12ubuntu1_amd64.deb /var/cache/apt/archives/libparams-validate-perl_0.93-1_amd64.deb <snip lota crap>. Tried to kill it but I cant –  glisignoli Feb 18 '11 at 11:31

Just ran into this bug myself - it's apparently known and actively worked on here:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/624877

share|improve this answer

I'd first try to find out what the process is trying to do and why it might have gotten stuck there. This is most likely a problem that is somewhat independent from the missing list of files (which you've already solved by installing the exact same version of the package on top; dpkg will just generate a new file list from the new package then).

I think there may be something wrong with your file system, such as a loop of directory hardlinks or other inconsistency that confuses the kernel here; thus the first step for me in this situation would be to confirm this (e.g. by checking which kernel function the process is blocked in), and, if that is truly the case, to reboot and force a file system check.

share|improve this answer
    
Agreed. It doesn't look like a dpkg/apt error to me. Have a look at the output of dmesg and see if there's any underlying problem. Also, try strace -fp <dpkg pid> to see what it's trying to do. –  SmallClanger Feb 18 '11 at 12:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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