unable to parse package file
When attempting to run package manager, I get the following:
Could not initialize the package information
A unresolvable problem occurred while initializing the package information.
Please report this bug against the 'update-manager' package and include the following error message:
'E:Unable to parse package file /var/lib/
Any suggestions on fixing this would be appreciated.
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- bertolton
- Solved:
- Last query:
- Last reply:
Revision history for this message
|
#1 |
Open a Terminal from the menu Applications → Accessories → Terminal and type:
(if the system ask you a password give your user password, you will not see nothing when you type it, then press enter)
sudo dpkg --configure -a
then to update and upgrade and also check pending or missing packages, still using terminal type:
sudo apt-get -f install
sudo apt-get --fix-missing install
sudo apt-get clean
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get clean
sudo apt-get autoremove
If you get errors please copy and paste here.
Hope this helps
Revision history for this message
|
#2 |
Hello marcobra,
Thanks for looking at this.
After typing
sudo apt-get -f install
I get:
Reading package lists... Error!
E: Unable to parse package file /var/lib/
E: The package lists or status file could not be parsed or opened.
Revision history for this message
|
#3 |
Please try this:
sudo apt-get clean
sudo apt-get update
...
Revision history for this message
|
#4 |
After sudo apt-get update, it fetches 189B, but then:
Reading package lists... Error!
E: Unable to parse package file /var/lib/
E: The package lists or status file could not be parsed or opened.
Revision history for this message
|
#5 |
Maybe the file got corrupted somehow. Please post the output of:
ls -l /var/lib/
It should be 20459656 bytes in size.
Maybe your root filesystem is full? Please check, and in case you don't know how, please post the output of this command:
df
Revision history for this message
|
#6 |
Hello Cruncher - thanks for taking a shot at this. Looks like the file you're talking about isn't even there; the output is:
ls: cannot access /var/lib/
Output from df is:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 37287660 3386296 32022164 10% /
varrun 253664 108 253556 1% /var/run
varlock 253664 0 253664 0% /var/lock
udev 253664 52 253612 1% /dev
devshm 253664 24 253640 1% /dev/shm
lrm 253664 39792 213872 16% /lib/modules/
gvfs-fuse-daemon 37287660 3386296 32022164 10% /home/bert/.gvfs
Revision history for this message
|
#7 |
Google is your friend :o)
This seems to be the solution:
"Try changing to the main server in synaptic -> settings -> repositories -> download from:" (taken from http://
Revision history for this message
|
#8 |
Hmmm...when I try to open synaptic package manager, I get the following error message:
E: Unable to parse package file /var/lib/
E: The package lists or status file could not be parsed or opened.
E: _cache->open() failed, please report.
Revision history for this message
|
#9 |
Wow.
How about Applications-
sudo apt-get update
Revision history for this message
|
#10 |
Wow indeed...I'm not finding System under the Applications. When I clicked on Add/Remove, I got the following:
Failed to check for installed and available applications
This is a major failure of your software management system. Please check for broken packages with synaptic, check the file permissions and correctness of the file '/etc/apt/
Is this looking like a reformat situation?
Revision history for this message
|
#11 |
No, it takes a lot to mess with a linux system before a reinstall is in order :o)
OK, since I have Xubuntu, which looks a little bit different, I am not sure where exactly the "SoftwareSources" entries is located. Do you have an "Administration" menu anywhere? It should be in there.
Otherwise, run this in a terminal, it will start the desired tool:
gksu --desktop /usr/share/
After you changed the server as decribed in my last post and ran "sudo apt-get update", try this again:
sudo apt-get install -f
If there is still an error somewhere, we will take a look at your /etc/apt/
BTW, do you remember what happened before that error occured? Did you cange something on your system, interrupted an installation/
Revision history for this message
|
#12 |
Oh man, I thought we had it...the update download ran, but an error message came up:
E: /var/cache/
Look, I'm not trying to be a nag, I'm just not real familiar with Linux or Ubuntu. I really appreciate the time you've taken with all this.
Bert
Revision history for this message
|
#13 |
No problem, we are here to help :-)
You have really strange bugs there, they all seem to indicate that at some point an upgate process was interrupted, which corrupted part of the database.
But we will restore the problematic files, in the hope there aren't too many of them. Please show me the output of the following commands:
dpkg -c /var/cache/
tail /var/lib/
ls -l /var/lib/
Revision history for this message
|
#14 |
The output of these commands would be important to make sure that the problem is not somewhere else, so it would be good if you executed the commands, and posted the output here, before trying anything else.
However, in theory the problem for that particular error you are getting should be fixed by this magic command (it is a multiline command, which will be automatically recognized, so you can/should just copy&paste the whole block):
dpkg -c /var/cache/
'{if ($6 == "./") { print "/."; } \
else if (substr($6, length($6), 1) == "/") \
{print substr($6, 2, length($6) - 2); } \
else { print substr($6, 2, length($6) - 1);}}' \
> /var/lib/
(info taken from here: http://
After that, try the apt-get command you used when you encountered that error (was it during "install -f" or during "upgrade")?
Revision history for this message
|
#15 |
Oops, you need to be root to write to files, so please use this command instead:
dpkg -c /var/cache/
'{if ($6 == "./") { print "/."; } \
else if (substr($6, length($6), 1) == "/") \
{print substr($6, 2, length($6) - 2); } \
else { print substr($6, 2, length($6) - 1);}}' \
2>&1|tee /var/lib/
Revision history for this message
|
#16 |
Hey Cruncher,
Working first from your post requesting output of three commands, output from first command is:
bert@bert-laptop:~$ dpkg -c /var/cache/
-rw-r--r-- root/root 19860 2009-03-26 17:49 ./usr/lib/
-rw-r--r-- root/root 9192 2009-03-26 17:49 ./usr/lib/
-rw-r--r-- root/root 19772 2009-03-26 17:49 ./usr/lib/
-rw-r--r-- root/root 15264 2009-03-26 17:49 ./usr/lib/
drwxr-xr-x root/root 0 2009-03-26 17:48 ./usr/share/
drwxr-xr-x root/root 0 2009-03-26 17:48 ./usr/share/doc/
drwxr-xr-x root/root 0 2009-03-26 17:49 ./usr/share/
-rw-r--r-- root/root 6547 2009-03-26 17:27 ./usr/share/
-rw-r--r-- root/root 120244 2007-10-19 04:25 ./usr/share/
-rw-r--r-- root/root 14788 2009-03-26 17:27 ./usr/share/
output from second command is:
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/share
/usr/share/doc
/usr/share/
/usr/share/
/usr/share/
/usr/share/
output from third command:
-rw-r--r-- 1 root root 840 2009-01-07 19:10 /var/lib/
-rw-r--r-- 1 root root 1335 2009-01-07 13:44 /var/lib/
-rwxr-xr-x 1 root root 321 2009-01-07 13:44 /var/lib/
-rw-r--r-- 1 root root 190 2009-01-07 13:43 /var/lib/
-rw-r--r-- 1 root root 24463 2009-01-07 13:43 /var/lib/
I don't know what the significance is, but in the above, in the third line, the portion " /var/lib/
I'll hold off on the "magic" command for now, just to avoid confusion. Semi off topic question; is there a good on line course on this stuff?
Revision history for this message
|
#17 |
Hm, it's getting stranger still... :o)
According to the output, the file doesn't appear to be corrupt. But maybe it's really just the final newline that's missing, so you should try the "magic command" now, it can't hurt.
About the green stuff: that's ok, it just means that that file is executable.
Revision history for this message
|
#18 |
O.K...tried it and here's the results:
bert@bert-laptop:~$ dpkg -c /var/cache/
> '{if ($6 == "./") { print "/."; } \
> else if (substr($6, length($6), 1) == "/") \
> {print substr($6, 2, length($6) - 2); } \
> else { print substr($6, 2, length($6) - 1);}}' \
> 2>&1|tee /var/lib/
tee: /var/lib/
/.
/usr
/usr/lib
/usr/lib/
/usr/lib/
/usr/lib/i486
/usr/lib/
/usr/lib/
/usr/lib/i586
/usr/lib/
/usr/lib/
/usr/lib/i686
/usr/lib/i686/cmov
/usr/lib/
/usr/lib/
/usr/lib/ssl
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/share
/usr/share/doc
/usr/share/
/usr/share/
/usr/share/
/usr/share/
Revision history for this message
|
#19 |
Woops, sorry, my mistake.
dpkg -c /var/cache/
'{if ($6 == "./") { print "/."; } \
else if (substr($6, length($6), 1) == "/") \
{print substr($6, 2, length($6) - 2); } \
else { print substr($6, 2, length($6) - 1);}}' \
2>&1|sudo tee /var/lib/
Revision history for this message
|
#20 |
No problem, here's the latest:
/.
/usr
/usr/lib
/usr/lib/
/usr/lib/
/usr/lib/i486
/usr/lib/
/usr/lib/
/usr/lib/i586
/usr/lib/
/usr/lib/
/usr/lib/i686
/usr/lib/i686/cmov
/usr/lib/
/usr/lib/
/usr/lib/ssl
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/share
/usr/share/doc
/usr/share/
/usr/share/
/usr/share/
/usr/share/
Revision history for this message
|
#21 |
Good. Now please try again the commands marcobra suggested in his very first answer. Good luck!
Revision history for this message
|
#22 |
It looked like that was going to work...got as far as "sudo apt-get upgrade", it ran a good while, then:
Fetched 37.7MB in 2min37s (239kB/s)
Preconfiguring packages ...
(Reading database ... dpkg: error processing /var/cache/
files list file for package `tcpd' is missing final newline
Errors were encountered while processing:
/var/cache/
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
Do you need to see the entire output?
Revision history for this message
|
#23 |
Hm, (almost) the same error again? I'm running out of ideas here... :o)
I'd suggest:
sudo dpkg -P libssl0.9.8
sudo rm /var/lib/
wget http://
sudo dpkg -i libssl0.
If that worked, you can try these again:
sudo apt-get -f install
sudo apt-get --fix-missing install
sudo apt-get upgrade
If that still didn't work, there might be a hiccup in the file system. That can be fixed by booting from the live CD and running:
sudo umount /dev/sda1
sudo e2fsck /dev/sda1
Revision history for this message
|
#24 |
Cruncher, I really appreciate the time you've put in on this. Win, lose or draw, my thanks.
The first command you suggested generated:
dpkg - warning: ignoring request to remove libsslo.9.8 which isn't installed.
Revision history for this message
|
#25 |
Better always use copy&paste of the commands given here, that's supposed to be a '0', not an 'o' :o)
Revision history for this message
|
#26 |
As Bugs Bunny used to say, "what a maroon". Point well taken and the resulting output is:
dpkg: dependency problems prevent removal of libssl0.9.8:
hplip depends on libssl0.9.8 (>= 0.9.8f-1).
libneon27 depends on libssl0.9.8 (>= 0.9.8e-1).
libpt-1.10.10 depends on libssl0.9.8 (>= 0.9.8f-1).
w3m depends on libssl0.9.8 (>= 0.9.8c-1).
ntpdate depends on libssl0.9.8 (>= 0.9.8f-1).
openssh-client depends on libssl0.9.8 (>= 0.9.8g-4ubuntu3.1).
libdns32 depends on libssl0.9.8 (>= 0.9.8f-1).
libdns35 depends on libssl0.9.8 (>= 0.9.8f-1).
rdesktop depends on libssl0.9.8 (>= 0.9.8f-1).
libsasl2-modules depends on libssl0.9.8 (>= 0.9.8f-1).
libcurl3 depends on libssl0.9.8 (>= 0.9.8f-1).
transmission-gtk depends on libssl0.9.8 (>= 0.9.8f-1).
bind9-host depends on libssl0.9.8 (>= 0.9.8f-1).
wget depends on libssl0.9.8 (>= 0.9.8e-1).
tcpdump depends on libssl0.9.8 (>= 0.9.8e-1).
libsnmp15 depends on libssl0.9.8 (>= 0.9.8f-1).
openoffice.
libwvstreams4.
python2.5 depends on libssl0.9.8 (>= 0.9.8f-1).
libopal-2.2 depends on libssl0.9.8 (>= 0.9.8f-1).
openssl depends on libssl0.9.8 (>= 0.9.8f-1).
hpijs depends on libssl0.9.8 (>= 0.9.8f-1).
dnsutils depends on libssl0.9.8 (>= 0.9.8f-1).
wpasupplicant depends on libssl0.9.8 (>= 0.9.8f-1).
dpkg: error processing libssl0.9.8 (--purge):
dependency problems - not removing
Errors were encountered while processing:
libssl0.9.8
Revision history for this message
|
#27 |
Hm, I though it was possible to temporarily break dependencies. Well, I had another idea we could try first. Maybe it really isn't libssl that's causing this. So to check all the relevant files for corruption, please open a text editor, for example:
gedit checkfiles.sh
Then copy this block in there, save and exit:
#!/bin/bash
for i in $( ls /var/lib/
if [ "`tail -1 $i | od -c -w1|tail -2|head -1|grep \\n`" = "" ]; then
if [ -s $i ]; then
echo $i
fi
fi
done
Then run this and post any files/output that it found:
sh checkfiles.sh
Revision history for this message
|
#28 |
Wow..here are the results:
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
Revision history for this message
|
#29 |
Hm, not good. I'd like to see one of them, for example:
od -c /var/lib/
If you have the possibility to backup your data (which is everything in /home), it might be worth to do start thinking about a clean install, because there might be corrupted more than these lists on your system. With the advantage that you could install 8.10 directly, and wouldn't have to bother with the upgrade.
Do you already have (any) Ubuntu (or other Linux) CD lying around? In that case the next step shuold be to check for file system corruption. You'd need to boot into some live CD or recovery environment, and then run:
sudo umount -f /dev/sda1
sudo e2fsck /dev/sda1
And watch whether it is fixing any errors.
Revision history for this message
|
#30 |
Better add '-f' to the last command:
sudo e2fsck -f /dev/sda1
Revision history for this message
|
#31 |
Here's the "od -c /var/lib/
0001400 0 , w a n t = 1 3 4 2 1 7 7 2
0001420 8 , l i m i t = 7 5 1 6 8 0 7
0001440 2 \n M a r 1 7 2 1 : 4 4 : 3
0001460 6 b e r t - l a p t o p k e
0001500 r n e l : [ 2 2 8 . 1 2 3
0001520 1 5 6 ] a t t e m p t t o
0001540 a c c e s s b e y o n d e n
0001560 d o f d e v i c e \n M a r
0001600 1 7 2 1 : 4 4 : 3 6 b e
0001616
Yup, I can back up /home and a clean install might be the best way to go. My only Linux CD is kind of old, but my working Ubuntu on my other computer is fine, so burning a new one shouldn't be a problem.
Revision history for this message
|
#32 |
This looks more and more like a file system corruption, that text doesn't belong there. Reparing the file system will usually stop the corruption, but it is hard to tell whether it will be able to fix all the errors. So you *could* try booting from a CD and issuing the two commands I gave, but unless you have performed some very special manual configurations which you need to preserve, a clean install (and formatting the drive at the start of the install) is probably the easiest (and fastest) solution.
Sorry!
Do you remember what happened to your system that caused all this?
Revision history for this message
|
#33 |
No need to apologize!!
You know, the only thing I can think of is that I've run updates too often from a wireless connection that wasn't real good. I'm not a heavy Internet user, don't game or download movies or any other higher risk connections. I don't know if interruptions might have caused the problems, but whatever it was, it's time to start over.
Anyway, Cruncher, you've done Yeoman's service and I thank you for your efforts. I will back up my data and just do a clean install along with a formatting. Again, thank you for all the time you put in on this. I learned quite a bit watching you attack the bugs.
Best regards,
Bert
Revision history for this message
|
#34 |
Hello, (THIS IS HOW I SOLVED IT)
-I had Ubuntu Server 8.04.
-I tried: sudo apt-get install ubuntu-desktop
-I then received a whole bunch of dependency issues.
-I tried these (which also gave errors similar to above):
sudo apt-get -f install
sudo apt-get --fix-missing install
sudo apt-get clean
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get clean
sudo apt-get autoremove
-I have enough space according to df. So, the files should download.
-I then realised, something is preventing the packages from being written.
-The culprit in my case was the MySQL server.
-I ran the line:
sudo /etc/init.d/mysql stop
-then:
sudo apt-get -f install
-Voila!!! Lift off.
kind regards,
JaEGeR.