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

Thread: Error on upgrade

  1. #1
    Join Date
    Jun 2011
    Beans
    Hidden!

    Error on upgrade

    I tried to run
    Code:
    sudo apt-get update && sudo apt-get upgrade
    in Raring and got the following error:
    Code:
    99 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    Need to get 0 B/120 MB of archives.
    After this operation, 677 kB of additional disk space will be used.
    Do you want to continue [Y/n]? y
    Extracting templates from packages: 100%
    Preconfiguring packages ...
    dpkg: error: parsing file '/var/lib/dpkg/available' near line 0:
     field name `#' must be followed by colon
    E: Sub-process /usr/bin/dpkg returned an error code (2)
    I've been running Raring on this computer for a couple months, and have been running updates and upgrades daily; this is the first problem I've had of this sort. Anyone else? Anyone know how to fix it?

  2. #2
    Join Date
    Oct 2008
    Location
    ExodusHair<Čubura
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Error on upgrade

    Quote Originally Posted by mcellius View Post
    I tried to run
    Code:
    sudo apt-get update && sudo apt-get upgrade
    in Raring and got the following error:
    Code:
    99 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    Need to get 0 B/120 MB of archives.
    After this operation, 677 kB of additional disk space will be used.
    Do you want to continue [Y/n]? y
    Extracting templates from packages: 100%
    Preconfiguring packages ...
    dpkg: error: parsing file '/var/lib/dpkg/available' near line 0:
     field name `#' must be followed by colon
    E: Sub-process /usr/bin/dpkg returned an error code (2)
    I've been running Raring on this computer for a couple months, and have been running updates and upgrades daily; this is the first problem I've had of this sort. Anyone else? Anyone know how to fix it?
    In Your place, I would try moving /var/lib/dpkg/available to some other place or (simply) renaming it (/var/lib/dpkg/available.zika for example) and trying update/upgrade again...

  3. #3
    Join Date
    Feb 2013
    Beans
    Hidden!

    Re: Error on upgrade

    You can safely delete /var/lib/dpkg/available.
    Code:
    sudo dpkg --clear-avail
    It's rarely used nowadays (the main user is dselect), and can be easily recreated if needed by dselect or aptitude from the apt package database:
    Code:
    sudo aptitude update
    or
    Code:
    sudo dselect --expert update
    Note that sudo apt-get update doesn't update /var/lib/dpkg/available

  4. #4
    Join Date
    Jun 2011
    Beans
    Hidden!

    Re: Error on upgrade

    Zika: Thank you! I tried this:

    In Your place, I would try moving /var/lib/dpkg/available to some other place or (simply) renaming it (/var/lib/dpkg/available.zika for example) and trying update/upgrade again...
    It didn't work. I got this:

    Code:
    dpkg: error: failed to open package info file `/var/lib/dpkg/available' for reading: No such file or directory
    E: Sub-process /usr/bin/dpkg returned an error code (2)
    Apparently it needs that file. (But I did, in your honor, rename the file to "available.zika".)

  5. #5
    Join Date
    Oct 2008
    Location
    ExodusHair<Čubura
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Error on upgrade

    Quote Originally Posted by schragge View Post
    You can safely delete /var/lib/dpkg/available.
    Code:
    sudo dpkg --clear-avail
    It's rarely used nowadays (the main user is dselect), and can be easily recreated if needed by dselect or aptitude from the apt package database:
    Code:
    sudo aptitude update
    or
    Code:
    sudo dselect --expert update
    Note that sudo apt-get update doesn't update /var/lib/dpkg/available
    I did not use aptitude in weeks but still file /var/lib/dpkg/available carry the time and date of my last update/upgrade via apt-get several minutes ago... Not the time of update but of one of these:
    Code:
    :~$ alias UPALL
    alias UPALL='/usr/bin/sudo /usr/bin/apt-get update ; /usr/bin/sudo /usr/bin/apt-get upgrade ; /usr/bin/sudo /usr/bin/apt-get clean ; /usr/bin/sudo /usr/bin/apt-get --purge autoremove'

  6. #6
    Join Date
    Oct 2008
    Location
    ExodusHair<Čubura
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Error on upgrade

    Quote Originally Posted by mcellius View Post
    Zika: Thank you! I tried this:

    It didn't work. I got this:

    Code:
    dpkg: error: failed to open package info file `/var/lib/dpkg/available' for reading: No such file or directory
    E: Sub-process /usr/bin/dpkg returned an error code (2)
    Apparently it needs that file. (But I did, in your honor, rename the file to "available.zika".)
    That is why I suggested You to rename, so that it can be returned if needed...

  7. #7
    Join Date
    Feb 2013
    Beans
    Hidden!

    Re: Error on upgrade

    Well, obviously it's presence gets checked by dpkg, but the information in it doesn't get used by apt-get. As said, you can
    Code:
    sudo dpkg --clear-avail
    any time.

    On my system, I use custom /var/lib/dpkg/available that contains only packages with priority standard or higher. I generate it from /var/lib/apt/lists/* with a script.

    Update.
    Besides dselect, the only other command I can think of that evaluates it is dpkg -l (for not installed packages).
    Last edited by schragge; February 15th, 2013 at 05:10 PM.

  8. #8
    Join Date
    Jun 2011
    Beans
    Hidden!

    Re: Error on upgrade

    Schragge: That worked, thank you!

    Just to be obsessive about everything, I copied available.zika back, then followed your instructions for clearing it. I then ran update and upgrade again, and it made it all the way through. Excellent!

    Thank you, both of you, for your help. I was figuring I was just going to need to reinstall Raring - not a big deal, as it's for testing, anyway, but I didn't really want to do that today. Now it all looks good.
    Last edited by mcellius; February 15th, 2013 at 05:13 PM.

  9. #9
    Join Date
    Feb 2013
    Beans
    Hidden!

    Re: Error on upgrade

    I'm curious, what /var/lib/dpkg/availalble contains now, after you've updated the package database? I guess it's still empty even if it got timestamped during update.
    Last edited by schragge; February 15th, 2013 at 05:21 PM.

  10. #10
    Join Date
    Oct 2008
    Location
    ExodusHair<Čubura
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Error on upgrade

    This is why I like to be on Forum like this... I learn every day... Thank You both of You. For stimulus and for new pieces of puzzle...

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
  •