3

I have been trying to update Ubuntu 12.04 on the command line by using the two commands

sudo apt-get update
sudo apt-get dist-upgrade

which ends with the following error:

(Reading database ... 70%dpkg: ../../src/filesdb.c:683: findnamenode: Assertion `(*pointerp)->name[0] == '/'' failed.
E: Sub-process /usr/bin/dpkg exited unexpectedly

How to fix this on the command line?

Alex
  • 5,700
  • This one could be hard to track down. It might be either hardware problems, or a messed-up installation. Please provide complete details in the question of what you did, including commands typed and output. – Faheem Mitha Feb 04 '14 at 12:37

1 Answers1

1

The solution to this messed up installation is as follows.

  1. Remove some installation files

    /var/cache/apt/pkgcache.bin /var/cache/apt/srcpkgcache.bin

  2. Run sudo apt-get dist-upgrade again.

  3. Now the output is even more garbled up:

    Preparing to replace jenkins 1.548 (using .../archives/jenkins_1.549_all.deb) ...
     * Stopping Jenkins Continuous Integration Server    jenkins                                                                [ OK ] 
    Unpacking replacement jenkins ...
    dpkg-deb (subprocess): data: internal gzip read error: '<fd:4>: invalid distance code'
    dpkg-deb: error: subprocess <decompress> returned error exit status 2
    dpkg: error processing /var/cache/apt/archives/jenkins_1.549_all.deb (--unpack):
     short read on buffer copy for backend dpkg-deb during `./usr/share/jenkins/jenkins.war'
    No apport report written because MaxReports is reached already
                                                           * Starting Jenkins     Continuous Integration Server jenkins  [ OK ] 
    Errors were encountered while processing:
     /var/cache/apt/archives/jenkins_1.549_all.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    

    but provides a hint of what was incorrectly installed: jenkins.

  4. Now remove this incomplete installation with sudo apt-get purge jenkins.

  5. Install it again (if you still need it): sudo apt-get install jenkins
  6. And finally sudo apt-get update && sudo apt-get dist-upgrade
Alex
  • 5,700