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

Thread: Parse Error in file var/lib/dpkg/status

  1. #1
    Join Date
    Sep 2009
    Beans
    48

    Angry Parse Error in file var/lib/dpkg/status

    When I tried to update i got this error.

    Parse Error in file var/lib.dpkg/status near line 36571 package 'language-pack-gnome-en'

    I have performed some trouble shooting with the people on #ubuntu-ie to no avail.

    We followed the trouble shooting from http://ubuntuforums.org/archive/index.php/t-474587.html

    and tried to re-do the script from http://linuxmafia.com/faq/Debian/pac...e-rebuild.html

    but running that script gives

    # Test existence of any subdirs in /var. If they exist, exit, otherwise
    # risk destroying an active system. If they don't exist, the remainder
    # of this script is safe.

    function create_new_dir () {
    ./New_Status: 31: Syntax error: "(" unexpected

    This is the line with the error : $1 exists, aborting" 1>&2

    Can someone help me out on this as my next step will be a re-install I think?

    Thanks in advance
    Last edited by jonny_bowes; January 30th, 2010 at 06:49 PM.

  2. #2
    Join Date
    Sep 2008
    Beans
    796

    Re: Parse Error in file var/lib/dpkg/status

    Try this:

    Code:
    sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status
    sudo aptitude update
    sudo aptitude safe-upgrade

  3. #3
    Join Date
    Sep 2009
    Beans
    48

    Re: Parse Error in file var/lib/dpkg/status

    Quote Originally Posted by paul_in_london View Post
    Try this:

    Code:
    sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status
    sudo aptitude update
    sudo aptitude safe-upgrade
    Just tried it but no change

    dpkg: parse error, in file '/var/lib/dpkg/status' near line 36571 package 'language-pack-gnome-en':
    newline in field name `
    E: Sub-process /usr/bin/dpkg returned an error code (2)
    A package failed to install. Trying to recover:
    dpkg: parse error, in file '/var/lib/dpkg/status' near line 36571 package 'language-pack-gnome-en'

    I think maybe both status files are corrupt.
    Last edited by jonny_bowes; January 31st, 2010 at 01:10 AM.

  4. #4
    Join Date
    Sep 2008
    Beans
    796

    Re: Parse Error in file var/lib/dpkg/status

    Instead of /var/lib/dpkg/status-old try /var/backups/dpkg.status.0

    It'll just mean reapplying a few more updates. Btw, you can do full-upgrade instead of safe-upgrade.

  5. #5
    Join Date
    Sep 2009
    Beans
    48

    Re: Parse Error in file var/lib/dpkg/status

    Quote Originally Posted by paul_in_london View Post
    Instead of /var/lib/dpkg/status-old try /var/backups/dpkg.status.0

    It'll just mean reapplying a few more updates. Btw, you can do full-upgrade instead of safe-upgrade.
    Hi Paul,I tried what you said and then did apt-get update and full-upgrade etc but got this at the end of the process.

    dpkg: parse error, in file '/var/lib/dpkg/status' near line 36571 package 'language-pack-gnome-en':
    newline in field name `
    E: Sub-process /usr/bin/dpkg returned an error code (2)
    A package failed to install. Trying to recover:
    dpkg: parse error, in file '/var/lib/dpkg/status' near line 36571 package 'language-pack-gnome-en':
    newline in field name `

  6. #6
    Join Date
    Sep 2008
    Beans
    796

    Re: Parse Error in file var/lib/dpkg/status

    Hi Jonny,

    How long ago did this happen? In /var/backups there are other backups of the status file (dpkg.status.1.gz, dpkg.status.2.gz etc). Try unzipping one or more of those and replacing your corrupted status file with an even older one.

    This is the corresponding part of my status file to give you an idea how it should look:

    Code:
    Package: language-pack-gnome-en
    Status: install ok installed
    Priority: optional
    Section: translations
    Installed-Size: 36
    Maintainer: Language pack maintainers <language-packs@ubuntu.com>
    Architecture: all
    Version: 1:10.04+20100109
    Replaces: language-pack-en (<< 1:10.04+20100109), language-pack-en-base (<< 1:10.04+20100109), language-pack-gnome-en (<< 1:10.04+20100109), language-pack-gnome-en-base, language-pack-kde-en (<< 1:10.04+20100109), language-pack-kde-en-base (<< 1:10.04+20100109)
    Depends: language-pack-gnome-en-base (>= 1:10.04+20100109), language-pack-en-base (>= 1:10.04+20100109)
    Pre-Depends: dpkg (>= 1.10.27ubuntu1)
    Description: GNOME translation updates for language English
     Translation data updates for all supported GNOME packages for:
     English
     .
     language-pack-gnome-en-base provides the bulk of translation data
     and is updated only seldom. This package provides frequent translation
     updates.
     .
     Please note that you should install language-support-en
     to get full support for this language.
    
    Package: wireless-tools
    If you compare it with your entry for this package you might be able to fix your status file with some manual edits. I'm using Lucid so not every detail will be the same.

    Before you update again with a different status file, I would also suggest that you boot into recovery mode, select netroot from the menu and run your commands from there.

    HTH

  7. #7
    Join Date
    Sep 2009
    Beans
    48

    Re: Parse Error in file var/lib/dpkg/status

    I looked in the back-ups and there are 5 or 6 of those back ups dating back to 17/01/2010. This issue started 3 or 4 days ago so I will pick one a few days before that again to be sure.

    Thanks and I'll report back with my findings

  8. #8
    Join Date
    Sep 2009
    Beans
    48

    Talking Re: Parse Error in file var/lib/dpkg/status

    Paul you are a legend!!

    It all looks fine and update/upgrade ok.


    Should I remove the corrupt ones now?

  9. #9
    Join Date
    Sep 2008
    Beans
    796

    Re: Parse Error in file var/lib/dpkg/status

    Glad it worked. If you've updated and upgraded ok then /var/lib/dpkg/status-old and /var/lib/dpkg/status will have sorted themselves out. You could now do something like:

    Code:
    sudo cp /var/lib/dpkg/status /var/lib/dpkg/status.ok.31012010
    so that you'll have another one to fall back on and then just delete any corrupt backups you may have found in /var/backups

  10. #10
    Join Date
    Sep 2009
    Beans
    48

    Re: Parse Error in file var/lib/dpkg/status

    Quote Originally Posted by paul_in_london View Post
    Glad it worked. If you've updated and upgraded ok then /var/lib/dpkg/status-old and /var/lib/dpkg/status will have sorted themselves out. You could now do something like:

    Code:
    sudo cp /var/lib/dpkg/status /var/lib/dpkg/status.ok.31012010
    so that you'll have another one to fall back on and then just delete any corrupt backups you may have found in /var/backups
    Thanks Paul,
    I shall gladly mark this as solved!!

    Big up to the community!!

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
  •