Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: APT fails after fixing disk

  1. #1
    Join Date
    Aug 2011
    Beans
    33

    APT fails after fixing disk

    Hi,

    I just had some major corruptions on my /root partition that made it impossible to start the system. So I did a fsck on it from recovery and now the system starts like normal.

    But there was apparently some files that could not be restored correctly(or have bin written to during corruption) and one of them is for apt so now I can't upgrade or reinstall package.

    Any suggestions on how to fix this?

    Code:
    root@*****:~# aptitude upgrade
    The following packages will be upgraded: 
      apport bzr cron gamin gstreamer0.10-plugins-base:i386 gstreamer0.10-x:i386 language-pack-en 
      language-pack-gnome-en libgamin0 libgnutls-dev libgnutls-openssl27 libgnutls26 libgnutls26:i386 
      libgnutlsxx27 libgstreamer-plugins-base0.10-0:i386 libgtk-3-0 libgtk-3-bin libgtk-3-common libjpeg-turbo8 
      libjpeg-turbo8:i386 libpango1.0-0 libpango1.0-0:i386 libtiff4 libtiff4:i386 postfix python-apport 
      python-bzrlib python-gamin python-problem-report xkb-data 
    30 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    Need to get 0 B/10,9 MB of archives. After unpacking 2 152 kB will be used.
    Do you want to continue? [Y/n/?] 
    Preconfiguring packages ...              
    (Reading database ... 
    dpkg: warning: files list file for package `apt-utils' missing, assuming package has no files currently installed.
    (Reading database ... 55%dpkg: unrecoverable fatal error, aborting:
     files list file for package `libv4lconvert0:i386' contains empty filename
    E: Sub-process /usr/bin/dpkg returned an error code (2)
    A package failed to install.  Trying to recover:
                                             
    root@****:~#

  2. #2
    Join Date
    Feb 2010
    Location
    UK
    Beans
    130
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: APT fails after fixing disk

    Try to run this:
    Code:
    run sudo dpkg --configure
    later on you may try:
    Code:
    sudo apt-get install -f
    or a combo:
    Code:
    sudo dpkg --configure -a --force-all
    If it won't work you may have lost some data, files ,etc. which had held vital informations for apt-get. Try to rebuild them or something like that.
    Sorry for spare solution, but I don't understand fully what has happen due to this coruption.
    Last edited by Laiquendi; July 22nd, 2012 at 04:18 PM.

  3. #3
    Join Date
    Aug 2011
    Beans
    33

    Re: APT fails after fixing disk

    Sadly it didn't help. The problem is that the system think the package is installed and working correctly so it will not try to reinstall even with -f

    I don't even understand if it is the apt-utils or libv4lconvert0:i386 that fails from reading the error message. And both packages is so embedded in the system so trying to remove them and reinstall seams impossible.

  4. #4
    Join Date
    May 2009
    Location
    rocket city,al,usa
    Beans
    659
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: APT fails after fixing disk

    Welcome to Ubuntu Forums

    Run this in a terminal
    Code:
      sudo apt-get update
    and post the results if there are errors

  5. #5
    Join Date
    Aug 2011
    Beans
    33

    Re: APT fails after fixing disk

    Quote Originally Posted by jmfal View Post
    Welcome to Ubuntu Forums

    Run this in a terminal
    Code:
      sudo apt-get update
    and post the results if there are errors

    Sadly no errors.

  6. #6
    Join Date
    Nov 2008
    Location
    S.H.I.E.L.D. 6-1-6
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: APT fails after fixing disk

    Sounds like your apt-utils file list is corrupted or missing
    Removing it, and reinstalling will regenerate it. (ignore errors in the first line, it is just to make sure there is no apt-utils list there already)
    Code:
    sudo mv /var/lib/dpkg/info/apt-utils.list /opt/apt-utils.list.backup
    sudo apt-get update
    sudo apt-get install --reinstall apt-utils
    Last edited by sandyd; July 22nd, 2012 at 06:53 PM.
    Don't waste your energy trying to change opinions ... Do your thing, and don't care if they like it.

  7. #7
    Join Date
    May 2009
    Location
    rocket city,al,usa
    Beans
    659
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: APT fails after fixing disk

    Try rebooting into the recovery kernal in the grub screen

    run>>dpkg fix broken packages
    follow prompts
    if requested to run command manually it will probably be one of these:
    Code:
      sudo dpkg --configure -a
                    sudo apt-get install -f
    resume normal boot
    attempt what you are doing again

  8. #8
    Join Date
    Aug 2011
    Beans
    33

    Re: APT fails after fixing disk

    Quote Originally Posted by sandyd View Post
    Sounds like your apt-utils file list is corrupted or missing
    Removing it, and reinstalling will regenerate it. (ignore errors in the first line, it is just to make sure there is no apt-utils list there already)
    Code:
    sudo mv /var/lib/dpkg/info/apt-utils.list /opt/apt-utils.list.backup
    sudo apt-get update
    sudo apt-get install --reinstall apt-utils
    I think you are correct but it didn't work.
    First of all I don't have the file /var/lib/dpkg/info/apt-utils.list so I could not move it. But I do have an md5 file, should I remove it?

    And doing the reinstall gave me the same error

    Code:
    root@****:~# apt-get install --reinstall apt-utils
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 46 not upgraded.
    Need to get 0 B/191 kB of archives.
    After this operation, 0 B of additional disk space will be used.
    Selecting previously unselected package apt-utils.
    (Reading database ... 
    dpkg: warning: files list file for package `apt-utils' missing, assuming package has no files currently installed.
    (Reading database ... 55%dpkg: unrecoverable fatal error, aborting:
     files list file for package `libv4lconvert0:i386' contains empty filename
    E: Sub-process /usr/bin/dpkg returned an error code (2)
    root@****:~#
    Last edited by Sun_Blood; July 22nd, 2012 at 07:00 PM.

  9. #9
    Join Date
    Aug 2011
    Beans
    33

    Re: APT fails after fixing disk

    Quote Originally Posted by jmfal View Post
    Try rebooting into the recovery kernal in the grub screen

    run>>dpkg fix broken packages
    follow prompts
    if requested to run command manually it will probably be one of these:
    Code:
      sudo dpkg --configure -a
                    sudo apt-get install -f
    resume normal boot
    attempt what you are doing again
    Do I need to be in recovery? Then I must move the computer(server) so I'll try it later.

  10. #10
    Join Date
    Nov 2008
    Location
    S.H.I.E.L.D. 6-1-6
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: APT fails after fixing disk

    Quote Originally Posted by Sun_Blood View Post
    I think you are correct but it didn't work.
    First of all I don't have the file /var/lib/dpkg/info/apt-utils.list so I could not move it.
    And doing the reinstall gave me the same error

    Code:
    root@****:~# apt-get install --reinstall apt-utils
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 46 not upgraded.
    Need to get 0 B/191 kB of archives.
    After this operation, 0 B of additional disk space will be used.
    Selecting previously unselected package apt-utils.
    (Reading database ... 
    dpkg: warning: files list file for package `apt-utils' missing, assuming package has no files currently installed.
    (Reading database ... 55%dpkg: unrecoverable fatal error, aborting:
     files list file for package `libv4lconvert0:i386' contains empty filename
    E: Sub-process /usr/bin/dpkg returned an error code (2)
    root@****:~#
    hmm. Apt being fussy again I see.

    Run
    Code:
    ls /var/cache/apt/archives/apt-utils*
    If there is only one file,

    Try
    Code:
    sudo dpkg -i --force all /var/cache/apt/archives/apt-utils*deb
    Else, post the output.

    Should work this time - I deleted mine to check.
    Don't waste your energy trying to change opinions ... Do your thing, and don't care if they like it.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •