cant use package manager

Asked by Tony Dalmeyer

When I try to install updates or use the package manager i get the error message
dpkg: parse error, in file `/var/lib/dpkg/available' near line 1:
 field name `

suggested solution run dpfg-reconfigure localpurge
when this command is run the origonal message repeats

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gnome-terminal Edit question
Assignee:
No assignee Edit question
Solved by:
Tony Dalmeyer
Solved:
Last query:
Last reply:
Revision history for this message
Tony Dalmeyer (tdalmeyer) said :
#1

I also tried to access the file available but its not able to be openened.I notice theres an old available file there also.

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#2

Please open a Terminal from the menu Applications->Accessories->Terminal and type:

sudo dpkg-reconfigure localepurge

give your user password when requested, you don't see nothing when you type it, then press enter.

Hope this helps

Revision history for this message
Tony Dalmeyer (tdalmeyer) said :
#3

dpkg-query: parse error, in file `/var/lib/dpkg/available' near line 1:
 field name `
/usr/sbin/dpkg-reconfigure: localepurge is not installed
 when i enter the command this is the result.

For some strange reason the file can't be openend,
I checked my other comp and this file is fine

Revision history for this message
Tony Dalmeyer (tdalmeyer) said :
#4

I think whats happened that a alteration was made to my software sources and the available file was corrupted.
the new available file created is locked therefore my software updates can't be completed.

The question is how can this be fixed?

Revision history for this message
subliminalfix (na1tr2lp-deactivatedaccount) said :
#5

When I try to install updates or use the package manager i get the error message
dpkg: parse error, in file `/var/lib/dpkg/available' near line 1:
 field name `

suggested solution run dpfg-reconfigure localpurge
when this command is run the origonal message repeats

dpkg

is not the same as dpfg

reinstall dpkg

sudo apt-get

sudo apt-get install

dpkg

configure dpkg

im a noob so im not sure which to use but the terminal will tell you when your succesfull

peace =]

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#6

This page may help you: http://ubuntuforums.org/showthread.php?t=389997

Hope this helps

Revision history for this message
Tony Dalmeyer (tdalmeyer) said :
#7

when i run apt-get update the following message appearsE: Could not open lock file /var/lib/apt/lists/lock - open (13 Permission denied)
E: Unable to lock the list directory

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#8

Please type:

sudo apt-get update

You must use "sudo"... then give your user password when requested, you don't see nothing when you type it, then press enter.

Thank you

Revision history for this message
Tony Dalmeyer (tdalmeyer) said :
#9

I appreciate your quick response but I'm not entirely new to Linux.
Yes I use sudo for my commands.

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#10

Please give the output of:

ls -la /var/lib/apt/lists/lock

mine is:
-rw-r----- 1 root root 0 Mar 24 23:00 /var/lib/apt/lists/lock

Thank you

Revision history for this message
Tony Dalmeyer (tdalmeyer) said :
#11

-rw-r----- 1 root root 0 2008-03-25 00:54 /var/lib/apt/lists/lock

Revision history for this message
Tony Dalmeyer (tdalmeyer) said :
#12

mine appears the same as yours does that help?

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#13

can you copy and paste the result of:

ls -l /var/lib/dpkg/available

Thank you

Revision history for this message
Tony Dalmeyer (tdalmeyer) said :
#14

this is the result

ls: /var/lib/dpkg/available: No such file or directory

Revision history for this message
Tony Dalmeyer (tdalmeyer) said :
#15

in fact this file was deleted by an earlier command
ie rm checking the actual folder reveals that the old available is the only one remaining

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#16

Why don't you try to restore the old file and try...

cp /var/lib/dpkg/available.old /var/lib/dpkg/available

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#17

sorry
sudo cp /var/lib/dpkg/available.old /var/lib/dpkg/available

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#18

Here my ls -l /var/lib/dpkg/

drwxr-xr-x 2 root root 4096 Mar 23 23:20 alternatives
-rw-r--r-- 1 root root 2732018 Mar 24 23:30 available
-rw-r--r-- 1 root root 2732018 Mar 24 20:55 available-old
-rw-r--r-- 1 root root 8 Feb 1 2007 cmethopt
-rw-r--r-- 1 root root 3369 Oct 3 22:11 diversions
-rw-r--r-- 1 root root 3308 Oct 3 22:11 diversions-old
drwxr-xr-x 2 root root 405504 Mar 24 20:55 info
-rw-r----- 1 root root 0 Mar 25 00:00 lock
drwxr-xr-x 5 root root 4096 Feb 1 2007 methods
drwxr-xr-x 2 root root 4096 Nov 24 2006 parts
-rw-r--r-- 1 root root 77 Aug 12 2007 statoverride
-rw-r--r-- 1 root root 30 Mar 28 2007 statoverride-old
-rw-r--r-- 1 root root 2522278 Mar 24 20:57 status
-rw-r--r-- 1 root root 2522433 Mar 24 20:55 status-old
drwxr-xr-x 2 root root 4096 Mar 24 20:55 triggers
drwxr-xr-x 2 root root 4096 Mar 24 20:57 updates

Revision history for this message
Tony Dalmeyer (tdalmeyer) said :
#19

Thanks heaps Marcobra seems to be working at the moment

.Yes its done!!!!\\I think I have an underlying problem with my processor.

 Now for my mythtv which is now botched up after the last update.